Package org.hibernate.metadata
Interface ClassMetadata
-
- All Known Implementing Classes:
AbstractEntityPersister,JoinedSubclassEntityPersister,SingleTableEntityPersister,UnionSubclassEntityPersister
public interface ClassMetadataExposes entity class metadata to the application- See Also:
SessionFactory.getClassMetadata(Class)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetEntityName()The name of the entityjava.io.SerializablegetIdentifier(java.lang.Object object)Deprecated.default java.io.SerializablegetIdentifier(java.lang.Object entity, SessionImplementor session)Deprecated.java.io.SerializablegetIdentifier(java.lang.Object entity, SharedSessionContractImplementor session)Get the identifier of an instance (throw an exception if no identifier property)java.lang.StringgetIdentifierPropertyName()Get the name of the identifier property (or return null)TypegetIdentifierType()Get the identifier Hibernate typejava.lang.ClassgetMappedClass()The persistent class, or nullint[]getNaturalIdentifierProperties()Which properties hold the natural id?boolean[]getPropertyLaziness()Get the "laziness" of the properties of this classjava.lang.String[]getPropertyNames()Get the names of the class' persistent propertiesboolean[]getPropertyNullability()Get the nullability of the class' persistent propertiesTypegetPropertyType(java.lang.String propertyName)Get the type of a particular (named) propertyType[]getPropertyTypes()Get the Hibernate types of the class propertiesjava.lang.ObjectgetPropertyValue(java.lang.Object object, java.lang.String propertyName)Get the value of a particular (named) propertyjava.lang.Object[]getPropertyValues(java.lang.Object entity)Extract the property values from the given entity.default java.lang.Object[]getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, SessionImplementor session)Deprecated.(since 5.3) Use the form accepting SharedSessionContractImplementor insteadjava.lang.Object[]getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, SharedSessionContractImplementor session)Return the values of the mapped properties of the objectjava.lang.ObjectgetVersion(java.lang.Object object)Get the version number (or timestamp) from the object's version property (or return null if not versioned)intgetVersionProperty()Get the index of the version propertybooleanhasIdentifierProperty()Does this class have an identifier property?booleanhasNaturalIdentifier()Does this entity declare a natural id?booleanhasProxy()Does this class support dynamic proxies?booleanhasSubclasses()Does this entity have mapped subclasses?booleanimplementsLifecycle()Does the class implement the Lifecycle interface?default java.lang.Objectinstantiate(java.io.Serializable id, SessionImplementor session)Deprecated.(since 5.3) Use the form accepting SharedSessionContractImplementor insteadjava.lang.Objectinstantiate(java.io.Serializable id, SharedSessionContractImplementor session)Create a class instance initialized with the given identifierbooleanisInherited()Does this entity extend a mapped superclass?booleanisMutable()Are instances of this class mutable?booleanisVersioned()Are instances of this class versioned by a timestamp or version number column?default voidsetIdentifier(java.lang.Object entity, java.io.Serializable id, SessionImplementor session)Deprecated.voidsetIdentifier(java.lang.Object entity, java.io.Serializable id, SharedSessionContractImplementor session)Inject the identifier value into the given entity.voidsetPropertyValue(java.lang.Object object, java.lang.String propertyName, java.lang.Object value)Set the value of a particular (named) propertyvoidsetPropertyValues(java.lang.Object object, java.lang.Object[] values)Set the given values to the mapped properties of the given object
-
-
-
Method Detail
-
getEntityName
java.lang.String getEntityName()
The name of the entity
-
getIdentifierPropertyName
java.lang.String getIdentifierPropertyName()
Get the name of the identifier property (or return null)
-
getPropertyNames
java.lang.String[] getPropertyNames()
Get the names of the class' persistent properties
-
getIdentifierType
Type getIdentifierType()
Get the identifier Hibernate type
-
getPropertyTypes
Type[] getPropertyTypes()
Get the Hibernate types of the class properties
-
getPropertyType
Type getPropertyType(java.lang.String propertyName) throws HibernateException
Get the type of a particular (named) property- Throws:
HibernateException
-
hasProxy
boolean hasProxy()
Does this class support dynamic proxies?
-
isMutable
boolean isMutable()
Are instances of this class mutable?
-
isVersioned
boolean isVersioned()
Are instances of this class versioned by a timestamp or version number column?
-
getVersionProperty
int getVersionProperty()
Get the index of the version property
-
getPropertyNullability
boolean[] getPropertyNullability()
Get the nullability of the class' persistent properties
-
getPropertyLaziness
boolean[] getPropertyLaziness()
Get the "laziness" of the properties of this class
-
hasIdentifierProperty
boolean hasIdentifierProperty()
Does this class have an identifier property?
-
hasNaturalIdentifier
boolean hasNaturalIdentifier()
Does this entity declare a natural id?
-
getNaturalIdentifierProperties
int[] getNaturalIdentifierProperties()
Which properties hold the natural id?
-
hasSubclasses
boolean hasSubclasses()
Does this entity have mapped subclasses?
-
isInherited
boolean isInherited()
Does this entity extend a mapped superclass?
-
getPropertyValuesToInsert
@Deprecated default java.lang.Object[] getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, SessionImplementor session) throws HibernateExceptionDeprecated.(since 5.3) Use the form accepting SharedSessionContractImplementor insteadReturn the values of the mapped properties of the object- Throws:
HibernateException
-
getPropertyValuesToInsert
java.lang.Object[] getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, SharedSessionContractImplementor session) throws HibernateExceptionReturn the values of the mapped properties of the object- Throws:
HibernateException
-
getMappedClass
java.lang.Class getMappedClass()
The persistent class, or null
-
instantiate
@Deprecated default java.lang.Object instantiate(java.io.Serializable id, SessionImplementor session)Deprecated.(since 5.3) Use the form accepting SharedSessionContractImplementor insteadCreate a class instance initialized with the given identifier- Parameters:
id- The identifier value to use (may be null to represent no value)session- The session from which the request originated.- Returns:
- The instantiated entity.
-
instantiate
java.lang.Object instantiate(java.io.Serializable id, SharedSessionContractImplementor session)Create a class instance initialized with the given identifier- Parameters:
id- The identifier value to use (may be null to represent no value)session- The session from which the request originated.- Returns:
- The instantiated entity.
-
getPropertyValue
java.lang.Object getPropertyValue(java.lang.Object object, java.lang.String propertyName) throws HibernateExceptionGet the value of a particular (named) property- Throws:
HibernateException
-
getPropertyValues
java.lang.Object[] getPropertyValues(java.lang.Object entity) throws HibernateExceptionExtract the property values from the given entity.- Parameters:
entity- The entity from which to extract the property values.- Returns:
- The property values.
- Throws:
HibernateException
-
setPropertyValue
void setPropertyValue(java.lang.Object object, java.lang.String propertyName, java.lang.Object value) throws HibernateExceptionSet the value of a particular (named) property- Throws:
HibernateException
-
setPropertyValues
void setPropertyValues(java.lang.Object object, java.lang.Object[] values) throws HibernateExceptionSet the given values to the mapped properties of the given object- Throws:
HibernateException
-
getIdentifier
@Deprecated java.io.Serializable getIdentifier(java.lang.Object object) throws HibernateExceptionDeprecated.Get the identifier of an instance (throw an exception if no identifier property)- Throws:
HibernateException
-
getIdentifier
@Deprecated default java.io.Serializable getIdentifier(java.lang.Object entity, SessionImplementor session)Deprecated.Get the identifier of an instance (throw an exception if no identifier property)- Parameters:
entity- The entity for which to get the identifiersession- The session from which the request originated- Returns:
- The identifier
-
getIdentifier
java.io.Serializable getIdentifier(java.lang.Object entity, SharedSessionContractImplementor session)Get the identifier of an instance (throw an exception if no identifier property)- Parameters:
entity- The entity for which to get the identifiersession- The session from which the request originated- Returns:
- The identifier
-
setIdentifier
@Deprecated default void setIdentifier(java.lang.Object entity, java.io.Serializable id, SessionImplementor session)Deprecated.Inject the identifier value into the given entity.- Parameters:
entity- The entity to inject with the identifier value.id- The value to be injected as the identifier.session- The session from which is requests originates
-
setIdentifier
void setIdentifier(java.lang.Object entity, java.io.Serializable id, SharedSessionContractImplementor session)Inject the identifier value into the given entity.- Parameters:
entity- The entity to inject with the identifier value.id- The value to be injected as the identifier.session- The session from which is requests originates
-
implementsLifecycle
boolean implementsLifecycle()
Does the class implement the Lifecycle interface?
-
getVersion
java.lang.Object getVersion(java.lang.Object object) throws HibernateExceptionGet the version number (or timestamp) from the object's version property (or return null if not versioned)- Throws:
HibernateException
-
-