Top Description Methods
org.hibernate.metadata

public Interface ClassMetadata

Known Direct Subinterfaces
org.hibernate.persister.entity.DeprecatedEntityStuff
Annotations
@Deprecated
since:6.0
Imports
java.util.Map, org.hibernate.HibernateException, org.hibernate.engine.spi.SessionImplementor, .SharedSessionContractImplementor, org.hibernate.type.Type

Deprecated

since 6.0.

Use Hibernate's mapping model org.hibernate.metamodel.MappingMetamodel

Exposes entity class metadata to the application
Author
Gavin King

Method Summary

Modifier and TypeMethod and Description
public String
getEntityName()

The name of the entity

public default Object
getIdentifier(Object object)

Get the identifier of an instance (throw an exception if no identifier property)
public default Object

Returns:

The identifier
getIdentifier
(Object
The entity for which to get the identifier
entity
,
SessionImplementor
The session from which the request originated
session
)

Get the identifier of an instance (throw an exception if no identifier property)
public Object

Returns:

The identifier
getIdentifier
(Object
The entity for which to get the identifier
entity
,
SharedSessionContractImplementor
The session from which the request originated
session
)

Get the identifier of an instance (throw an exception if no identifier property)

public String
getIdentifierPropertyName()

Get the name of the identifier property (or return null)

public Type
getIdentifierType()

Get the identifier Hibernate type

public Class<?>
getMappedClass()

The persistent class, or null

public int[]
getNaturalIdentifierProperties()

Which properties hold the natural id?

public boolean[]
getPropertyLaziness()

Get the "laziness" of the properties of this class

public String[]
getPropertyNames()

Get the names of the class' persistent properties

public boolean[]
getPropertyNullability()

Get the nullability of the class' persistent properties

public Type
getPropertyType(String propertyName)

Get the type of a particular (named) property

public Type[]
getPropertyTypes()

Get the Hibernate types of the class properties

public Object
getPropertyValue(Object object, String propertyName)

Get the value of a particular (named) property

public Object[]

Returns:

The property values.
getPropertyValues
(Object
The entity from which to extract the property values.
entity
)

Extract the property values from the given entity.

public default Object[]
getPropertyValuesToInsert(Object entity, Map<Object, Object> mergeMap, SessionImplementor session)

Deprecated since 5.3. Use the form accepting SharedSessionContractImplementor instead
Return the values of the mapped properties of the object
public Object[]
getPropertyValuesToInsert(Object entity, Map<Object, Object> mergeMap, SharedSessionContractImplementor session)

Return the values of the mapped properties of the object

public Object
getVersion(Object object)

Get the version number (or timestamp) from the object's version property (or return null if not versioned)

public int
getVersionProperty()

Get the index of the version property

public boolean
hasIdentifierProperty()

Does this class have an identifier property?

public boolean
hasNaturalIdentifier()

Does this entity declare a natural id?

public boolean
hasProxy()

Does this class support dynamic proxies?

public boolean
hasSubclasses()

Does this entity have mapped subclasses?

public boolean
implementsLifecycle()

Does the class implement the Lifecycle interface?

public default Object

Returns:

The instantiated entity.
instantiate
(Object
The identifier value to use (may be null to represent no value)
id
,
SessionImplementor
The session from which the request originated.
session
)

Deprecated since 5.3. Use the form accepting SharedSessionContractImplementor instead
Create a class instance initialized with the given identifier
public Object

Returns:

The instantiated entity.
instantiate
(Object
The identifier value to use (may be null to represent no value)
id
,
SharedSessionContractImplementor
The session from which the request originated.
session
)

Create a class instance initialized with the given identifier

public boolean
isInherited()

Does this entity extend a mapped superclass?

public boolean
isMutable()

Are instances of this class mutable?

public boolean
isVersioned()

Are instances of this class versioned by a timestamp or version number column?

public default void
setIdentifier(Object
The entity to inject with the identifier value.
entity
,
Object
The value to be injected as the identifier.
id
,
SessionImplementor
The session from which is requests originates
session
)

Inject the identifier value into the given entity.
public void
setIdentifier(Object
The entity to inject with the identifier value.
entity
,
Object
The value to be injected as the identifier.
id
,
SharedSessionContractImplementor
The session from which is requests originates
session
)

Inject the identifier value into the given entity.

public void
setPropertyValue(Object object, String propertyName, Object value)

Set the value of a particular (named) property

public void
setPropertyValues(Object object, Object[] values)

Set the given values to the mapped properties of the given object

Method Detail

getEntityNameback to summary
public String getEntityName()

The name of the entity

getIdentifierback to summary
public default Object getIdentifier(Object object) throws HibernateException

Get the identifier of an instance (throw an exception if no identifier property)

Annotations
@Deprecated
getIdentifierback to summary
public default Object getIdentifier(Object entity, SessionImplementor session)

Get the identifier of an instance (throw an exception if no identifier property)

Parameters
entity:Object

The entity for which to get the identifier

session:SessionImplementor

The session from which the request originated

Returns:Object

The identifier

Annotations
@Deprecated
getIdentifierback to summary
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)

Get the identifier of an instance (throw an exception if no identifier property)

Parameters
entity:Object

The entity for which to get the identifier

session:SharedSessionContractImplementor

The session from which the request originated

Returns:Object

The identifier

getIdentifierPropertyNameback to summary
public String getIdentifierPropertyName()

Get the name of the identifier property (or return null)

getIdentifierTypeback to summary
public Type getIdentifierType()

Get the identifier Hibernate type

getMappedClassback to summary
public Class<?> getMappedClass()

The persistent class, or null

getNaturalIdentifierPropertiesback to summary
public int[] getNaturalIdentifierProperties()

Which properties hold the natural id?

getPropertyLazinessback to summary
public boolean[] getPropertyLaziness()

Get the "laziness" of the properties of this class

getPropertyNamesback to summary
public String[] getPropertyNames()

Get the names of the class' persistent properties

getPropertyNullabilityback to summary
public boolean[] getPropertyNullability()

Get the nullability of the class' persistent properties

getPropertyTypeback to summary
public Type getPropertyType(String propertyName) throws HibernateException

Get the type of a particular (named) property

getPropertyTypesback to summary
public Type[] getPropertyTypes()

Get the Hibernate types of the class properties

getPropertyValueback to summary
public Object getPropertyValue(Object object, String propertyName) throws HibernateException

Get the value of a particular (named) property

getPropertyValuesback to summary
public Object[] getPropertyValues(Object entity) throws HibernateException

Extract the property values from the given entity.

Parameters
entity:Object

The entity from which to extract the property values.

Returns:Object[]

The property values.

getPropertyValuesToInsertback to summary
public default Object[] getPropertyValuesToInsert(Object entity, Map<Object, Object> mergeMap, SessionImplementor session) throws HibernateException

Deprecated

since 5.3.

Use the form accepting SharedSessionContractImplementor instead

Return the values of the mapped properties of the object

Annotations
@Deprecated
since:5.3
@SuppressWarnings:UnusedDeclaration
getPropertyValuesToInsertback to summary
public Object[] getPropertyValuesToInsert(Object entity, Map<Object, Object> mergeMap, SharedSessionContractImplementor session) throws HibernateException

Return the values of the mapped properties of the object

Annotations
@SuppressWarnings:UnusedDeclaration
getVersionback to summary
public Object getVersion(Object object) throws HibernateException

Get the version number (or timestamp) from the object's version property (or return null if not versioned)

getVersionPropertyback to summary
public int getVersionProperty()

Get the index of the version property

hasIdentifierPropertyback to summary
public boolean hasIdentifierProperty()

Does this class have an identifier property?

hasNaturalIdentifierback to summary
public boolean hasNaturalIdentifier()

Does this entity declare a natural id?

hasProxyback to summary
public boolean hasProxy()

Does this class support dynamic proxies?

hasSubclassesback to summary
public boolean hasSubclasses()

Does this entity have mapped subclasses?

implementsLifecycleback to summary
public boolean implementsLifecycle()

Does the class implement the Lifecycle interface?

Annotations
@SuppressWarnings:UnusedDeclaration
instantiateback to summary
public default Object instantiate(Object id, SessionImplementor session)

Deprecated

since 5.3.

Use the form accepting SharedSessionContractImplementor instead

Create a class instance initialized with the given identifier

Parameters
id:Object

The identifier value to use (may be null to represent no value)

session:SessionImplementor

The session from which the request originated.

Returns:Object

The instantiated entity.

Annotations
@Deprecated
since:5.3
instantiateback to summary
public Object instantiate(Object id, SharedSessionContractImplementor session)

Create a class instance initialized with the given identifier

Parameters
id:Object

The identifier value to use (may be null to represent no value)

session:SharedSessionContractImplementor

The session from which the request originated.

Returns:Object

The instantiated entity.

isInheritedback to summary
public boolean isInherited()

Does this entity extend a mapped superclass?

isMutableback to summary
public boolean isMutable()

Are instances of this class mutable?

isVersionedback to summary
public boolean isVersioned()

Are instances of this class versioned by a timestamp or version number column?

setIdentifierback to summary
public default void setIdentifier(Object entity, Object id, SessionImplementor session)

Inject the identifier value into the given entity.

Parameters
entity:Object

The entity to inject with the identifier value.

id:Object

The value to be injected as the identifier.

session:SessionImplementor

The session from which is requests originates

Annotations
@Deprecated
setIdentifierback to summary
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)

Inject the identifier value into the given entity.

Parameters
entity:Object

The entity to inject with the identifier value.

id:Object

The value to be injected as the identifier.

session:SharedSessionContractImplementor

The session from which is requests originates

setPropertyValueback to summary
public void setPropertyValue(Object object, String propertyName, Object value) throws HibernateException

Set the value of a particular (named) property

setPropertyValuesback to summary
public void setPropertyValues(Object object, Object[] values) throws HibernateException

Set the given values to the mapped properties of the given object