Package org.javers.core.metamodel.type
Class EntityType
java.lang.Object
org.javers.core.metamodel.type.JaversType
org.javers.core.metamodel.type.ManagedType
org.javers.core.metamodel.type.EntityType
- Direct Known Subclasses:
ShallowReferenceType
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
Example:
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;
...
}
-
Field Summary
Fields inherited from class org.javers.core.metamodel.type.JaversType
DEFAULT_TYPE_PARAMETER -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateIdFromInstance(Object instance) createIdFromInstanceId(Object localId) booleanbooleaninthashCode()booleanisIdProperty(JaversProperty property) booleanisInstance(Object cdo) protected PrettyPrintBuildertoString()Methods inherited from class org.javers.core.metamodel.type.ManagedType
findProperty, forEachProperty, getProperties, getProperties, getProperty, getPropertyNames, getRawDehydratedTypeMethods inherited from class org.javers.core.metamodel.type.JaversType
buildListOfConcreteTypeArguments, equals, getBaseJavaType, getConcreteClassTypeArguments, getName, isGenericType, prettyPrint, spawnConstructorArgs, spawnConstructorArgTypes
-
Method Details
-
getIdProperties
- Returns:
- an immutable, non-null list with at least one element
-
getIdProperty
- Throws:
RuntimeException- if this Entity has Composite Id
-
hasCompositeId
public boolean hasCompositeId() -
isIdProperty
-
getIdOf
- Parameters:
instance- instance ofgetBaseJavaClass()- Returns:
- returns ID of given instance (value of idProperty)
-
createIdFromInstance
-
createIdFromInstanceId
-
createIdFromDeserializedJsonLocalId
-
equals
- Overrides:
equalsin classJaversType
-
hashCode
public int hashCode()- Overrides:
hashCodein classJaversType
-
toString
- Overrides:
toStringin classJaversType
-
prettyPrintBuilder
- Overrides:
prettyPrintBuilderin classManagedType
-
getLocalIdDehydratedJsonType
-
canBePrototype
public boolean canBePrototype()- Specified by:
canBePrototypein classJaversType
-
isInstance
- Specified by:
isInstancein classJaversType
-
getBaseJavaClass
-