T - Entity typepublic interface JpaEntity<T> extends com.holonplatform.core.Expression, Serializable
| Modifier and Type | Method and Description |
|---|---|
static <T> JpaEntity<T> |
create(javax.persistence.metamodel.Metamodel metamodel,
Class<T> entityClass)
Create a new
JpaEntity from given entityClass. |
Class<T> |
getEntityClass()
Get the entity class.
|
String |
getEntityName()
Get the entity name.
|
Optional<Object> |
getId(T entity)
Get the id value of given entity istance.
|
Optional<Class<?>> |
getIdType()
Get the type of the entity id, if available.
|
boolean |
hasCompositeId()
Get whether the entity has a composite id.
|
boolean |
isNew(T entity)
Gets whether given entity instance has to be considered new according to entity id value.
|
String getEntityName()
Optional<Class<?>> getIdType() throws IllegalStateException
IllegalStateException - If the entity identifier metadata are not availableboolean hasCompositeId()
throws IllegalStateException
true if the entity has a composite (multi attribute) id, false if the entity
has a simple (single attribute) id or if the entity id is not availableIllegalStateException - If the entity identifier metadata are not availableOptional<Object> getId(T entity) throws IllegalStateException
entity - Entity istance (not null)IllegalStateException - If the entity identifier metadata are not availableboolean isNew(T entity) throws IllegalStateException
When entity id is not available, always returns false.
entity - Entity instance (not null)true if entity instance has to be considered new, false otherwiseIllegalStateException - If the entity identifier metadata are not availablestatic <T> JpaEntity<T> create(javax.persistence.metamodel.Metamodel metamodel, Class<T> entityClass)
JpaEntity from given entityClass.T - Entity typemetamodel - JPA Metamodel (not null)entityClass - Entity class (not null)JpaEntityCopyright © 2019 The Holon Platform. All rights reserved.