public interface

ClassMetadata

org.hibernate.metadata.ClassMetadata
Known Indirect Subclasses

Class Overview

Exposes entity class metadata to the application

Summary

Public Methods
abstract String getEntityName()
The name of the entity
abstract Serializable getIdentifier(Object object, EntityMode entityMode)
This method is deprecated. Use getIdentifier(Object, SessionImplementor) instead
abstract Serializable getIdentifier(Object entity, SessionImplementor session)
Get the identifier of an instance (throw an exception if no identifier property)
abstract String getIdentifierPropertyName()
Get the name of the identifier property (or return null)
abstract Type getIdentifierType()
Get the identifier Hibernate type
abstract Class getMappedClass(EntityMode entityMode)
The persistent class, or null
abstract int[] getNaturalIdentifierProperties()
Which properties hold the natural id?
abstract boolean[] getPropertyLaziness()
Get the "laziness" of the properties of this class
abstract String[] getPropertyNames()
Get the names of the class' persistent properties
abstract boolean[] getPropertyNullability()
Get the nullability of the class' persistent properties
abstract Type getPropertyType(String propertyName)
Get the type of a particular (named) property
abstract Type[] getPropertyTypes()
Get the Hibernate types of the class properties
abstract Object getPropertyValue(Object object, String propertyName, EntityMode entityMode)
Get the value of a particular (named) property
abstract Object[] getPropertyValues(Object entity, EntityMode entityMode)
Extract the property values from the given entity.
abstract Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SessionImplementor session)
Return the values of the mapped properties of the object
abstract Object getVersion(Object object, EntityMode entityMode)
Get the version number (or timestamp) from the object's version property (or return null if not versioned)
abstract int getVersionProperty()
Get the index of the version property
abstract boolean hasIdentifierProperty()
Does this class have an identifier property?
abstract boolean hasNaturalIdentifier()
Does this entity declare a natural id?
abstract boolean hasProxy()
Does this class support dynamic proxies?
abstract boolean hasSubclasses()
Does this entity have mapped subclasses?
abstract boolean implementsLifecycle(EntityMode entityMode)
Does the class implement the Lifecycle interface?
abstract boolean implementsValidatable(EntityMode entityMode)
Does the class implement the Validatable interface?
abstract Object instantiate(Serializable id, SessionImplementor session)
Create a class instance initialized with the given identifier
abstract Object instantiate(Serializable id, EntityMode entityMode)
This method is deprecated. Use instantiate(Serializable, SessionImplementor) instead
abstract boolean isInherited()
Does this entity extend a mapped superclass?
abstract boolean isMutable()
Are instances of this class mutable?
abstract boolean isVersioned()
Are instances of this class versioned by a timestamp or version number column?
abstract void setIdentifier(Object entity, Serializable id, EntityMode entityMode)
This method is deprecated. Use setIdentifier(Object, Serializable, SessionImplementor) instead.
abstract void setIdentifier(Object entity, Serializable id, SessionImplementor session)
Inject the identifier value into the given entity.
abstract void setPropertyValue(Object object, String propertyName, Object value, EntityMode entityMode)
Set the value of a particular (named) property
abstract void setPropertyValues(Object object, Object[] values, EntityMode entityMode)
Set the given values to the mapped properties of the given object

Public Methods

public abstract String getEntityName ()

The name of the entity

public abstract Serializable getIdentifier (Object object, EntityMode entityMode)

This method is deprecated.
Use getIdentifier(Object, SessionImplementor) instead

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

public abstract Serializable getIdentifier (Object entity, SessionImplementor session)

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

Parameters
entity The entity for which to get the identifier
session The session from which the request originated
Returns
  • The identifier

public abstract String getIdentifierPropertyName ()

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

public abstract Type getIdentifierType ()

Get the identifier Hibernate type

public abstract Class getMappedClass (EntityMode entityMode)

The persistent class, or null

public abstract int[] getNaturalIdentifierProperties ()

Which properties hold the natural id?

public abstract boolean[] getPropertyLaziness ()

Get the "laziness" of the properties of this class

public abstract String[] getPropertyNames ()

Get the names of the class' persistent properties

public abstract boolean[] getPropertyNullability ()

Get the nullability of the class' persistent properties

public abstract Type getPropertyType (String propertyName)

Get the type of a particular (named) property

public abstract Type[] getPropertyTypes ()

Get the Hibernate types of the class properties

public abstract Object getPropertyValue (Object object, String propertyName, EntityMode entityMode)

Get the value of a particular (named) property

public abstract Object[] getPropertyValues (Object entity, EntityMode entityMode)

Extract the property values from the given entity.

Parameters
entity The entity from which to extract the property values.
entityMode The entity-mode of the given entity
Returns
  • The property values.

public abstract Object[] getPropertyValuesToInsert (Object entity, Map mergeMap, SessionImplementor session)

Return the values of the mapped properties of the object

public abstract Object getVersion (Object object, EntityMode entityMode)

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

public abstract int getVersionProperty ()

Get the index of the version property

public abstract boolean hasIdentifierProperty ()

Does this class have an identifier property?

public abstract boolean hasNaturalIdentifier ()

Does this entity declare a natural id?

public abstract boolean hasProxy ()

Does this class support dynamic proxies?

public abstract boolean hasSubclasses ()

Does this entity have mapped subclasses?

public abstract boolean implementsLifecycle (EntityMode entityMode)

Does the class implement the Lifecycle interface?

public abstract boolean implementsValidatable (EntityMode entityMode)

Does the class implement the Validatable interface?

public abstract Object instantiate (Serializable id, SessionImplementor 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.

public abstract Object instantiate (Serializable id, EntityMode entityMode)

This method is deprecated.
Use instantiate(Serializable, SessionImplementor) instead

Create a class instance initialized with the given identifier

public abstract boolean isInherited ()

Does this entity extend a mapped superclass?

public abstract boolean isMutable ()

Are instances of this class mutable?

public abstract boolean isVersioned ()

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

public abstract void setIdentifier (Object entity, Serializable id, EntityMode entityMode)

This method is deprecated.
Use setIdentifier(Object, Serializable, SessionImplementor) instead.

Inject the identifier value into the given entity.

Has no effect if the entity does not define an identifier property

Parameters
entity The entity to inject with the identifier value.
id The value to be injected as the identifier.
entityMode The entity mode

public abstract void setIdentifier (Object entity, Serializable id, SessionImplementor 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

public abstract void setPropertyValue (Object object, String propertyName, Object value, EntityMode entityMode)

Set the value of a particular (named) property

public abstract void setPropertyValues (Object object, Object[] values, EntityMode entityMode)

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