Top Description Methods
org.hibernate.metamodel.model.domain

public Interface JpaMetamodel

extends Metamodel
Known Direct Subinterfaces
org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor, org.hibernate.Metamodel
Annotations
@Incubating
Imports
java.util.List, .Map, .Set, jakarta.persistence.metamodel.EmbeddableType, .EntityType, .ManagedType, .Metamodel, org.hibernate.Incubating, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.metamodel.MappingMetamodel, org.hibernate.service.ServiceRegistry, org.hibernate.type.spi.TypeConfiguration

Extensions to the JPA-defined metamodel of persistent Java types.
Author
Steve Ebersole
Since
6.0
See Also
MappingMetamodel

Method Summary

Modifier and TypeMethod and Description
public <T> void
addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)

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

Redeclares jakarta.persistence.metamodel.Metamodel.embeddable.

Return the metamodel embeddable type representing the embeddable class.
public <X> EntityDomainType<X>
entity(String entityName)

Access to an entity supporting Hibernate's entity-name feature

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

Redeclares jakarta.persistence.metamodel.Metamodel.entity.

Return the metamodel entity type representing the entity.
public <T> RootGraphImplementor<T>
public <T> List<RootGraphImplementor<? super T>>
public <X> EntityDomainType<X>
findEntityType(Class<X> cls)

Same as entity except null is returned rather than throwing an exception

public <X> ManagedDomainType<X>
findManagedType(Class<X> cls)

Same as managedType except null is returned rather than throwing an exception

public Map<String, Map<Class<?>, Enum<?>>>
getAllowedEnumLiteralTexts()

Returns a map that gives access to the enum literal expressions that can be used in queries.

public Set<EmbeddableType<?>>
getEmbeddables()

Redeclares jakarta.persistence.metamodel.Metamodel.getEmbeddables.

Return the metamodel embeddable types.
public Set<EntityType<?>>
getEntities()

Redeclares jakarta.persistence.metamodel.Metamodel.getEntities.

Return the metamodel entity types.
public <X> EntityDomainType<X>
getHqlEntityReference(String entityName)

Specialized handling for resolving entity-name references in an HQL query

public JpaCompliance
public Set<ManagedType<?>>
getManagedTypes()

Redeclares jakarta.persistence.metamodel.Metamodel.getManagedTypes.

Return the metamodel managed types.
public ServiceRegistry
public TypeConfiguration
getTypeConfiguration()

todo (6.0) : should we expose JpaMetamodel from TypeConfiguration?

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

Redeclares jakarta.persistence.metamodel.Metamodel.managedType.

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.
public String
public <X> EntityDomainType<X>
resolveHqlEntityReference(String entityName)

Specialized handling for resolving entity-name references in an HQL query

Method Detail

addNamedEntityGraphback to summary
public <T> void addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)
embeddableback to summary
public <X> EmbeddableDomainType<X> embeddable(Class<X> cls)

Redeclares jakarta.persistence.metamodel.Metamodel.embeddable.

Doc from jakarta.persistence.metamodel.Metamodel.embeddable.

Return the metamodel embeddable type representing the embeddable class.

Parameters
cls:Class<X>

the type of the represented embeddable class

Returns:EmbeddableDomainType<X>

the metamodel embeddable type

Annotations
@Override
entityback to summary
public <X> EntityDomainType<X> entity(String entityName)

Access to an entity supporting Hibernate's entity-name feature

entityback to summary
public <X> EntityDomainType<X> entity(Class<X> cls)

Redeclares jakarta.persistence.metamodel.Metamodel.entity.

Doc from jakarta.persistence.metamodel.Metamodel.entity.

Return the metamodel entity type representing the entity.

Parameters
cls:Class<X>

the type of the represented entity

Returns:EntityDomainType<X>

the metamodel entity type

Annotations
@Override
findEntityGraphByNameback to summary
public <T> RootGraphImplementor<T> findEntityGraphByName(String name)
findEntityGraphsByJavaTypeback to summary
public <T> List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> entityClass)
findEntityTypeback to summary
public <X> EntityDomainType<X> findEntityType(Class<X> cls)

Same as entity except null is returned rather than throwing an exception

findManagedTypeback to summary
public <X> ManagedDomainType<X> findManagedType(Class<X> cls)

Same as managedType except null is returned rather than throwing an exception

getAllowedEnumLiteralTextsback to summary
public Map<String, Map<Class<?>, Enum<?>>> getAllowedEnumLiteralTexts()

Returns a map that gives access to the enum literal expressions that can be used in queries. The key is the shorthand enum literal. The value is a map, from enum class to the actual enum value. This is needed for parsing shorthand enum literals that don't use FQNs.

getEmbeddablesback to summary
public Set<EmbeddableType<?>> getEmbeddables()

Redeclares jakarta.persistence.metamodel.Metamodel.getEmbeddables.

Doc from jakarta.persistence.metamodel.Metamodel.getEmbeddables.

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

Returns:Set<EmbeddableType<?>>

the metamodel embeddable types

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

Redeclares jakarta.persistence.metamodel.Metamodel.getEntities.

Doc from jakarta.persistence.metamodel.Metamodel.getEntities.

Return the metamodel entity types.

Returns:Set<EntityType<?>>

the metamodel entity types

Annotations
@Override
getHqlEntityReferenceback to summary
public <X> EntityDomainType<X> getHqlEntityReference(String entityName)

Specialized handling for resolving entity-name references in an HQL query

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

Redeclares jakarta.persistence.metamodel.Metamodel.getManagedTypes.

Doc from jakarta.persistence.metamodel.Metamodel.getManagedTypes.

Return the metamodel managed types.

Returns:Set<ManagedType<?>>

the metamodel managed types

Annotations
@Override
getServiceRegistryback to summary
public ServiceRegistry getServiceRegistry()
getTypeConfigurationback to summary
public TypeConfiguration getTypeConfiguration()

todo (6.0) : should we expose JpaMetamodel from TypeConfiguration?

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

Redeclares jakarta.persistence.metamodel.Metamodel.managedType.

Doc from jakarta.persistence.metamodel.Metamodel.managedType.

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:ManagedDomainType<X>

the metamodel managed type

Annotations
@Override
qualifyImportableNameback to summary
public String qualifyImportableName(String queryName)
resolveHqlEntityReferenceback to summary
public <X> EntityDomainType<X> resolveHqlEntityReference(String entityName)

Specialized handling for resolving entity-name references in an HQL query