Package org.fastnate.examples.model
Class Person
java.lang.Object
org.fastnate.examples.model.Person
A simple example of an entity for instances that are created with Java code or imported from files.
See
PersonData and "src/manin/data" for more.- Author:
- Tobias Liefke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe first name of the person - required according to JPA annotation.getId()The ID of the person - automatically assigned.The last name of the person - required according to Beans Validation.The associated organisation - as entity reference.The previous organisations of the person.All persons that have this person as supervisor.The immediate superior of this person.booleanisActive()voidsetActive(boolean active) voidsetEntryDate(Date entryDate) voidsetFirstName(String firstName) The first name of the person - required according to JPA annotation.voidThe ID of the person - automatically assigned.voidsetLastName(String lastName) The last name of the person - required according to Beans Validation.voidsetOrganisation(Organisation organisation) The associated organisation - as entity reference.voidsetSupervisor(Person supervisor) Sets the supervisor of thisPerson.toString()
-
Constructor Details
-
Person
Creates a new person with his / her first and last name.- Parameters:
firstName- the first name of the personlastName- the last name of the person
-
Person
public Person()
-
-
Method Details
-
setSupervisor
Sets the supervisor of thisPerson. Removes this person from thesubordinatesof the previous supervisor.- Parameters:
supervisor- the new supervisor
-
toString
-
getId
The ID of the person - automatically assigned. -
getFirstName
The first name of the person - required according to JPA annotation. -
getLastName
The last name of the person - required according to Beans Validation. -
getOrganisation
The associated organisation - as entity reference. -
getPreviousOrganisations
The previous organisations of the person. -
getSupervisor
The immediate superior of this person. -
getSubordinates
All persons that have this person as supervisor. -
getEntryDate
-
isActive
public boolean isActive() -
setId
The ID of the person - automatically assigned. -
setFirstName
The first name of the person - required according to JPA annotation. -
setLastName
The last name of the person - required according to Beans Validation. -
setOrganisation
The associated organisation - as entity reference. -
setEntryDate
-
setActive
public void setActive(boolean active)
-