Package io.jmix.core.entity
Class EntityValues
java.lang.Object
io.jmix.core.entity.EntityValues
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
getCreatedBy
(Object entity) static Object
getCreatedDate
(Object entity) static Object
getDeletedBy
(Object entity) static Object
getDeletedDate
(Object entity) static Object
getGeneratedId
(Object entity) static Object
static Object
getIdOrEntity
(Object entity) static Object
getLastModifiedBy
(Object entity) static Object
getLastModifiedDate
(Object entity) static UUID
static <T> T
Get an attribute value.static <T> T
getValueEx
(Object entity, PropertyPath propertyPath) Get an attribute value.static <T> T
getValueEx
(Object entity, String propertyPath) Get an attribute value.static <T> T
getValueEx
(Object entity, String[] properties) Get value of an attribute according to the rules described ingetValueEx(Object, String)
.static Object
getVersion
(Object entity) static boolean
isAuditSupported
(Object entity) static boolean
static boolean
isSoftDeleted
(Object entity) static boolean
isSoftDeletionSupported
(Object entity) static boolean
isUuidSupported
(Object entity) static boolean
isVersionSupported
(Object entity) static boolean
propertyValueEquals
(Object a, Object b) Checks whether an entity property value has been changed.static void
setCreatedBy
(Object entity, Object value) static void
setCreatedDate
(Object entity, Object value) static void
setDeletedBy
(Object entity, Object value) static void
setDeletedDate
(Object entity, Object value) static void
setGeneratedId
(Object entity, Object id) static void
static void
setLastModifiedBy
(Object entity, Object value) static void
setLastModifiedDate
(Object entity, Object value) static void
static void
Set an attribute value.static void
Set an attribute value.static void
setValueEx
(Object entity, PropertyPath propertyPath, Object value) Set an attribute value.static void
setValueEx
(Object entity, String[] properties, Object value) Set value of an attribute according to the rules described insetValueEx(Object, String, Object)
.static void
setValueEx
(Object entity, String propertyPath, Object value) Set an attribute value.static void
setVersion
(Object entity, Object version)
-
Constructor Details
-
EntityValues
public EntityValues()
-
-
Method Details
-
isEntity
-
getId
-
setId
-
getIdOrEntity
-
getGeneratedId
-
setGeneratedId
-
setValue
Set an attribute value.
An implementor should first read a current value of the attribute, and then call an appropriate setter method only if the new value differs. This ensures triggering ofEntityPropertyChangeListener
s only if the attribute was actually changed.- Parameters:
name
- attribute name according to JavaBeans notationvalue
- attribute value
-
setValue
Set an attribute value.
An implementor should first read a current value of the attribute, and then call an appropriate setter method only if the new value differs. This ensures triggering ofEntityPropertyChangeListener
s only if the attribute was actually changed.- Parameters:
name
- attribute name according to JavaBeans notationvalue
- attribute valuecheckEquals
- check equals for previous and new value. If flag is true and objects equals, then setter will not be invoked
-
getValue
Get an attribute value.- Parameters:
name
- attribute name according to JavaBeans notation- Returns:
- attribute value
-
getValueEx
Get an attribute value. Locates the attribute by the given path in object graph starting from this instance.
The path must consist of attribute names according to JavaBeans notation, separated by dots, e.g.car.driver.name
.- Parameters:
propertyPath
- path to an attribute- Returns:
- attribute value. If any traversing attribute value is null or is not an
Entity
, this method stops here and returns this value.
-
getValueEx
Get an attribute value. Locates the attribute by the given path in object graph starting from this instance.
The path must consist of attribute names according to JavaBeans notation, separated by dots, e.g.car.driver.name
.- Parameters:
propertyPath
- path to an attribute- Returns:
- attribute value. If any traversing attribute value is null or is not an
Entity
, this method stops here and returns this value.
-
setValueEx
Set an attribute value. Locates the attribute by the given path in object graph starting from this instance.
The path must consist of attribute names according to JavaBeans notation, separated by dots, e.g.car.driver.name
.
In the example above this method first gets value ofcar.driver
attribute, and if it is not null and is anEntity
, sets value ofname
attribute in it.
An implementor should first read a current value of the attribute, and then call an appropriate setter method only if the new value differs. This ensures triggering ofEntityPropertyChangeListener
s only if the attribute was actually changed.- Parameters:
propertyPath
- path to an attributevalue
- attribute value
-
setValueEx
Set an attribute value. Locates the attribute by the given path in object graph starting from this instance.
The path must consist of attribute names according to JavaBeans notation, separated by dots, e.g.car.driver.name
.
In the example above this method first gets value ofcar.driver
attribute, and if it is not null and is anEntity
, sets value ofname
attribute in it.
An implementor should first read a current value of the attribute, and then call an appropriate setter method only if the new value differs. This ensures triggering ofEntityPropertyChangeListener
s only if the attribute was actually changed.- Parameters:
propertyPath
- path to an attributevalue
- attribute value
-
setValueEx
Set value of an attribute according to the rules described insetValueEx(Object, String, Object)
.- Parameters:
entity
- instanceproperties
- path to the attributevalue
- attribute value
-
getValueEx
Get value of an attribute according to the rules described ingetValueEx(Object, String)
.- Parameters:
entity
- entityproperties
- path to the attribute- Returns:
- attribute value
-
propertyValueEquals
Checks whether an entity property value has been changed.- Parameters:
a
- an objectb
- an object- Returns:
- true if
a
equals tob
, but in case ofa
is an entity or a collection returns true only ifa
is the same instance asb
-
isUuidSupported
-
getUuid
-
setUuid
-
isVersionSupported
-
getVersion
-
setVersion
-
isSoftDeletionSupported
-
isSoftDeleted
-
getDeletedDate
-
setDeletedDate
-
getDeletedBy
-
setDeletedBy
-
isAuditSupported
-
getCreatedDate
-
setCreatedDate
-
getCreatedBy
-
setCreatedBy
-
getLastModifiedDate
-
setLastModifiedDate
-
getLastModifiedBy
-
setLastModifiedBy
-