Class EntityType

  • Direct Known Subclasses:
    ShallowReferenceType

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

    Has a list of mutable properties and its own identity held in Id-property (or a list of Id-properties).

    Two Entity instances are compared using Id-property, see InstanceId

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

      • getIdProperties

        public java.util.List<JaversProperty> getIdProperties()
        Returns:
        an immutable, non-null list with at least one element
      • getIdProperty

        public JaversProperty getIdProperty()
        Throws:
        java.lang.RuntimeException - if this Entity has Composite Id
      • hasCompositeId

        public boolean hasCompositeId()
      • 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)
      • createIdFromDehydratedLocalId

        public InstanceId createIdFromDehydratedLocalId​(java.lang.Object dehydratedLocalId)
      • equals

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

        public java.lang.reflect.Type getLocalIdDehydratedType()
      • isInstance

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

        public java.lang.Class getBaseJavaClass()