public interface ClassMetadata
Exposes entity class metadata to the application
SessionFactory.getClassMetadata(Class)
Type | Property and Description |
---|---|
boolean |
hasIdentifier
Does this class have an identifier property?
|
Modifier and Type | Method and Description |
---|---|
String |
getEntityName()
The name of the entity
|
Serializable |
getIdentifier(Object object)
Deprecated.
|
Serializable |
getIdentifier(Object entity,
SharedSessionContractImplementor session)
Get the identifier of an instance (throw an exception if no identifier property)
|
String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null)
|
Type |
getIdentifierType()
Get the identifier Hibernate type
|
Class |
getMappedClass()
The persistent class, or null
|
int[] |
getNaturalIdentifierProperties()
Which properties hold the natural id?
|
boolean[] |
getPropertyLaziness()
Get the "laziness" of the properties of this class
|
String[] |
getPropertyNames()
Get the names of the class' persistent properties
|
boolean[] |
getPropertyNullability()
Get the nullability of the class' persistent properties
|
Type |
getPropertyType(String propertyName)
Get the type of a particular (named) property
|
Type[] |
getPropertyTypes()
Get the Hibernate types of the class properties
|
Object |
getPropertyValue(Object object,
String propertyName)
Get the value of a particular (named) property
|
Object[] |
getPropertyValues(Object entity)
Extract the property values from the given entity.
|
Object[] |
getPropertyValuesToInsert(Object entity,
Map mergeMap,
SharedSessionContractImplementor session)
Return the values of the mapped properties of the object
|
Object |
getVersion(Object object)
Get the version number (or timestamp) from the object’s version property
(or return null if not versioned)
|
int |
getVersionProperty()
Get the index of the version property
|
boolean |
hasIdentifierProperty()
Does this class have an identifier property?
|
boolean |
hasNaturalIdentifier()
Does this entity declare a natural id?
|
boolean |
hasProxy()
Does this class support dynamic proxies?
|
boolean |
hasSubclasses()
Does this entity have mapped subclasses?
|
boolean |
implementsLifecycle()
Does the class implement the <tt>Lifecycle</tt> interface?
|
Object |
instantiate(Serializable id,
SharedSessionContractImplementor session)
Create a class instance initialized with the given identifier
|
boolean |
isInherited()
Does this entity extend a mapped superclass?
|
boolean |
isMutable()
Are instances of this class mutable?
|
boolean |
isVersioned()
Are instances of this class versioned by a timestamp or version number column?
|
void |
setIdentifier(Object entity,
Serializable id,
SharedSessionContractImplementor session)
Inject the identifier value into the given entity.
|
void |
setPropertyValue(Object object,
String propertyName,
Object value)
Set the value of a particular (named) property
|
void |
setPropertyValues(Object object,
Object[] values)
Set the given values to the mapped properties of the given object
|
boolean hasIdentifierProperty
Does this class have an identifier property?
String getEntityName()
The name of the entity
String getIdentifierPropertyName()
Get the name of the identifier property (or return null)
String[] getPropertyNames()
Get the names of the class' persistent properties
Type getIdentifierType()
Get the identifier Hibernate type
Type[] getPropertyTypes()
Get the Hibernate types of the class properties
Type getPropertyType(String propertyName) throws HibernateException
Get the type of a particular (named) property
HibernateException
boolean hasProxy()
Does this class support dynamic proxies?
boolean isMutable()
Are instances of this class mutable?
boolean isVersioned()
Are instances of this class versioned by a timestamp or version number column?
int getVersionProperty()
Get the index of the version property
boolean[] getPropertyNullability()
Get the nullability of the class' persistent properties
boolean[] getPropertyLaziness()
Get the "laziness" of the properties of this class
boolean hasIdentifierProperty()
Does this class have an identifier property?
boolean hasNaturalIdentifier()
Does this entity declare a natural id?
int[] getNaturalIdentifierProperties()
Which properties hold the natural id?
boolean hasSubclasses()
Does this entity have mapped subclasses?
boolean isInherited()
Does this entity extend a mapped superclass?
Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionContractImplementor session) throws HibernateException
Return the values of the mapped properties of the object
HibernateException
Class getMappedClass()
The persistent class, or null
Object instantiate(Serializable id, SharedSessionContractImplementor session)
Create a class instance initialized with the given identifier
id
- The identifier value to use (may be null to represent no value)session
- The session from which the request originated.Object getPropertyValue(Object object, String propertyName) throws HibernateException
Get the value of a particular (named) property
HibernateException
Object[] getPropertyValues(Object entity) throws HibernateException
Extract the property values from the given entity.
entity
- The entity from which to extract the property values.HibernateException
void setPropertyValue(Object object, String propertyName, Object value) throws HibernateException
Set the value of a particular (named) property
HibernateException
void setPropertyValues(Object object, Object[] values) throws HibernateException
Set the given values to the mapped properties of the given object
HibernateException
@Deprecated Serializable getIdentifier(Object object) throws HibernateException
getIdentifier(Object,SharedSessionContractImplementor)
insteadGet the identifier of an instance (throw an exception if no identifier property)
HibernateException
Serializable getIdentifier(Object entity, SharedSessionContractImplementor session)
Get the identifier of an instance (throw an exception if no identifier property)
entity
- The entity for which to get the identifiersession
- The session from which the request originatedvoid setIdentifier(Object entity, Serializable id, SharedSessionContractImplementor session)
Inject the identifier value into the given entity.
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 originatesboolean implementsLifecycle()
Does the class implement the <tt>Lifecycle</tt> interface?
Object getVersion(Object object) throws HibernateException
Get the version number (or timestamp) from the object’s version property (or return null if not versioned)
HibernateException
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.