Top Description Methods
javax.persistence.metamodel

public Interface Metamodel

Imports
java.util.Set

Provides access to the metamodel of persistent entities in the persistence unit.
Since
Java Persistence 2.0

Method Summary

Modifier and TypeMethod and Description
public <X> EmbeddableType<X>

Returns:

the metamodel embeddable type
embeddable
(Class<X>
the type of the represented embeddable class
cls
)

Return the metamodel embeddable type representing the embeddable class.

public <X> EntityType<X>

Returns:

the metamodel entity type
entity
(Class<X>
the type of the represented entity
cls
)

Return the metamodel entity type representing the entity.

public Set<EmbeddableType<?>>

Returns:

the metamodel embeddable types
getEmbeddables
()

Return the metamodel embeddable types.

public Set<EntityType<?>>

Returns:

the metamodel entity types
getEntities
()

Return the metamodel entity types.

public Set<ManagedType<?>>

Returns:

the metamodel managed types
getManagedTypes
()

Return the metamodel managed types.

public <X> ManagedType<X>

Returns:

the metamodel managed type
managedType
(Class<X>
the type of the represented managed class
cls
)

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.

Method Detail

embeddableback to summary
public <X> EmbeddableType<X> embeddable(Class<X> cls)

Return the metamodel embeddable type representing the embeddable class.

Parameters
cls:Class<X>

the type of the represented embeddable class

Returns:EmbeddableType<X>

the metamodel embeddable type

Exceptions
IllegalArgumentException:
if not an embeddable class
entityback to summary
public <X> EntityType<X> entity(Class<X> cls)

Return the metamodel entity type representing the entity.

Parameters
cls:Class<X>

the type of the represented entity

Returns:EntityType<X>

the metamodel entity type

Exceptions
IllegalArgumentException:
if not an entity
getEmbeddablesback to summary
public Set<EmbeddableType<?>> getEmbeddables()

Return the metamodel embeddable types. Returns empty set if there are no embeddable types.

Returns:Set<EmbeddableType<?>>

the metamodel embeddable types

getEntitiesback to summary
public Set<EntityType<?>> getEntities()

Return the metamodel entity types.

Returns:Set<EntityType<?>>

the metamodel entity types

getManagedTypesback to summary
public Set<ManagedType<?>> getManagedTypes()

Return the metamodel managed types.

Returns:Set<ManagedType<?>>

the metamodel managed types

managedTypeback to summary
public <X> ManagedType<X> managedType(Class<X> cls)

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.

Parameters
cls:Class<X>

the type of the represented managed class

Returns:ManagedType<X>

the metamodel managed type

Exceptions
IllegalArgumentException:
if not a managed class