Class EntityType

  • Direct Known Subclasses:
    ShallowReferenceType

    public class EntityType
    extends ManagedType
    Entity class in client's domain model.

    Has list of mutable properties and its own identity hold in idProperty.

    Two Entity instances are compared using idProperty, see InstanceId

    Example:
         class Person {
            @Id
             private int    personId;
             private String firstName;
             private String lastName;
             ...
         }
     
    • Method Detail

      • getIdPropertyGenericType

        public java.lang.reflect.Type getIdPropertyGenericType()
      • isIdProperty

        public boolean isIdProperty​(JaversProperty property)
      • getIdOf

        public java.lang.Object getIdOf​(java.lang.Object instance)
        Parameters:
        instance - instance of getBaseJavaClass()
        Returns:
        returns ID of given instance (value of idProperty)
      • createIdFromInstance

        public InstanceId createIdFromInstance​(java.lang.Object instance)
      • createIdFromInstanceId

        public InstanceId createIdFromInstanceId​(java.lang.Object localId)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class JaversType
      • isInstance

        public boolean isInstance​(java.lang.Object cdo)
        Specified by:
        isInstance in class JaversType
      • getBaseJavaClass

        public java.lang.Class getBaseJavaClass()