Class Person

  • All Implemented Interfaces:
    java.io.Serializable

    public class Person
    extends java.lang.Object
    implements java.io.Serializable
    Person class.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String firstName
      First name (not-indexed).
      java.lang.Long id
      Person ID (indexed).
      java.lang.String lastName
      Last name (not indexed).
      static java.lang.String ORG_SALARY_IDX
      Name of index by two fields (orgId, salary).
      java.lang.Long orgId
      Organization ID (indexed).
      java.lang.String resume
      Resume text (create LUCENE-based TEXT index for this field).
      double salary
      Salary (indexed).
    • Constructor Summary

      Constructors 
      Constructor Description
      Person()
      Default constructor.
      Person​(java.lang.Long id, java.lang.Long orgId, java.lang.String firstName, java.lang.String lastName, double salary, java.lang.String resume)
      Constructs person record.
      Person​(java.lang.Long id, java.lang.String firstName, java.lang.String lastName)
      Constructs person record.
      Person​(Organization org, java.lang.String firstName, java.lang.String lastName, double salary, java.lang.String resume)
      Constructs person record.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AffinityKey<java.lang.Long> key()
      Gets cache affinity key.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Person

        public Person()
        Default constructor.
      • Person

        public Person​(Organization org,
                      java.lang.String firstName,
                      java.lang.String lastName,
                      double salary,
                      java.lang.String resume)
        Constructs person record.
        Parameters:
        org - Organization.
        firstName - First name.
        lastName - Last name.
        salary - Salary.
        resume - Resume text.
      • Person

        public Person​(java.lang.Long id,
                      java.lang.Long orgId,
                      java.lang.String firstName,
                      java.lang.String lastName,
                      double salary,
                      java.lang.String resume)
        Constructs person record.
        Parameters:
        id - Person ID.
        orgId - Organization ID.
        firstName - First name.
        lastName - Last name.
        salary - Salary.
        resume - Resume text.
      • Person

        public Person​(java.lang.Long id,
                      java.lang.String firstName,
                      java.lang.String lastName)
        Constructs person record.
        Parameters:
        id - Person ID.
        firstName - First name.
        lastName - Last name.
    • Method Detail

      • key

        public AffinityKey<java.lang.Long> key()
        Gets cache affinity key. Since in some examples person needs to be collocated with organization, we create custom affinity key to guarantee this collocation.
        Returns:
        Custom affinity key to guarantee that person is always collocated with organization.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object