Class Person

java.lang.Object
org.fastnate.examples.model.Person

@Entity public class Person extends Object
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 Details

    • Person

      public Person(String firstName, String lastName)
      Creates a new person with his / her first and last name.
      Parameters:
      firstName - the first name of the person
      lastName - the last name of the person
    • Person

      public Person()
  • Method Details

    • setSupervisor

      public void setSupervisor(Person supervisor)
      Sets the supervisor of this Person. Removes this person from the subordinates of the previous supervisor.
      Parameters:
      supervisor - the new supervisor
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public Long getId()
      The ID of the person - automatically assigned.
    • getFirstName

      public String getFirstName()
      The first name of the person - required according to JPA annotation.
    • getLastName

      public String getLastName()
      The last name of the person - required according to Beans Validation.
    • getOrganisation

      public Organisation getOrganisation()
      The associated organisation - as entity reference.
    • getPreviousOrganisations

      public Collection<Organisation> getPreviousOrganisations()
      The previous organisations of the person.
    • getSupervisor

      public Person getSupervisor()
      The immediate superior of this person.
    • getSubordinates

      public Collection<Person> getSubordinates()
      All persons that have this person as supervisor.
    • getEntryDate

      public Date getEntryDate()
    • isActive

      public boolean isActive()
    • setId

      public void setId(Long id)
      The ID of the person - automatically assigned.
    • setFirstName

      public void setFirstName(String firstName)
      The first name of the person - required according to JPA annotation.
    • setLastName

      public void setLastName(String lastName)
      The last name of the person - required according to Beans Validation.
    • setOrganisation

      public void setOrganisation(Organisation organisation)
      The associated organisation - as entity reference.
    • setEntryDate

      public void setEntryDate(Date entryDate)
    • setActive

      public void setActive(boolean active)