public interface ClassMetadata
SessionFactory.getClassMetadata(Class)| Type | Property and Description |
|---|---|
boolean |
hasIdentifier
Does this class have an identifier property?
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getEntityName()
The name of the entity
|
java.io.Serializable |
getIdentifier(java.lang.Object object)
Deprecated.
Use
getIdentifier(Object,SessionImplementor) instead |
java.io.Serializable |
getIdentifier(java.lang.Object entity,
SessionImplementor session)
Get the identifier of an instance (throw an exception if no identifier property)
|
java.lang.String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null)
|
Type |
getIdentifierType()
Get the identifier Hibernate type
|
java.lang.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
|
java.lang.String[] |
getPropertyNames()
Get the names of the class' persistent properties
|
boolean[] |
getPropertyNullability()
Get the nullability of the class' persistent properties
|
Type |
getPropertyType(java.lang.String propertyName)
Get the type of a particular (named) property
|
Type[] |
getPropertyTypes()
Get the Hibernate types of the class properties
|
java.lang.Object |
getPropertyValue(java.lang.Object object,
java.lang.String propertyName)
Get the value of a particular (named) property
|
java.lang.Object[] |
getPropertyValues(java.lang.Object entity)
Extract the property values from the given entity.
|
java.lang.Object[] |
getPropertyValuesToInsert(java.lang.Object entity,
java.util.Map mergeMap,
SessionImplementor session)
Return the values of the mapped properties of the object
|
java.lang.Object |
getVersion(java.lang.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 Lifecycle interface?
|
java.lang.Object |
instantiate(java.io.Serializable id,
SessionImplementor 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(java.lang.Object entity,
java.io.Serializable id,
SessionImplementor session)
Inject the identifier value into the given entity.
|
void |
setPropertyValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
Set the value of a particular (named) property
|
void |
setPropertyValues(java.lang.Object object,
java.lang.Object[] values)
Set the given values to the mapped properties of the given object
|
boolean hasIdentifierProperty
java.lang.String getEntityName()
java.lang.String getIdentifierPropertyName()
java.lang.String[] getPropertyNames()
Type getIdentifierType()
Type[] getPropertyTypes()
Type getPropertyType(java.lang.String propertyName) throws HibernateException
HibernateExceptionboolean hasProxy()
boolean isMutable()
boolean isVersioned()
int getVersionProperty()
boolean[] getPropertyNullability()
boolean[] getPropertyLaziness()
boolean hasIdentifierProperty()
boolean hasNaturalIdentifier()
int[] getNaturalIdentifierProperties()
boolean hasSubclasses()
boolean isInherited()
java.lang.Object[] getPropertyValuesToInsert(java.lang.Object entity,
java.util.Map mergeMap,
SessionImplementor session)
throws HibernateException
HibernateExceptionjava.lang.Class getMappedClass()
java.lang.Object instantiate(java.io.Serializable id,
SessionImplementor session)
id - The identifier value to use (may be null to represent no value)session - The session from which the request originated.java.lang.Object getPropertyValue(java.lang.Object object,
java.lang.String propertyName)
throws HibernateException
HibernateExceptionjava.lang.Object[] getPropertyValues(java.lang.Object entity)
throws HibernateException
entity - The entity from which to extract the property values.HibernateExceptionvoid setPropertyValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
throws HibernateException
HibernateExceptionvoid setPropertyValues(java.lang.Object object,
java.lang.Object[] values)
throws HibernateException
HibernateException@Deprecated
java.io.Serializable getIdentifier(java.lang.Object object)
throws HibernateException
getIdentifier(Object,SessionImplementor) insteadHibernateExceptionjava.io.Serializable getIdentifier(java.lang.Object entity,
SessionImplementor session)
entity - The entity for which to get the identifiersession - The session from which the request originatedvoid setIdentifier(java.lang.Object entity,
java.io.Serializable id,
SessionImplementor session)
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()
java.lang.Object getVersion(java.lang.Object object)
throws HibernateException
HibernateExceptionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.