Class MetamodelImpl
- java.lang.Object
-
- org.apache.openjpa.persistence.meta.MetamodelImpl
-
-
Constructor Summary
Constructors Constructor Description MetamodelImpl(MetaDataRepository repos)Constructs a model with the current content of the supplied non-null repository.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassclassForName(java.lang.String name, java.lang.String[] imports)Resolve the type represented by the given class name.<X> jakarta.persistence.metamodel.EmbeddableType<X>embeddable(java.lang.Class<X> clazz)Return the metamodel embeddable type representing the embeddable class.<X> jakarta.persistence.metamodel.EntityType<X>entity(java.lang.Class<X> clazz)Return the metamodel entity type representing the entity.<X> jakarta.persistence.metamodel.EntityType<X>entityImpl(java.lang.Class<X> clazz)AggregateListenergetAggregateListener(java.lang.String tag)Return the function listener for the given tag, or null if none.OpenJPAConfigurationgetConfiguration()Return the OpenJPA configuration.java.util.Set<jakarta.persistence.metamodel.EmbeddableType<?>>getEmbeddables()Return the metamodel embeddable types.java.util.Set<jakarta.persistence.metamodel.EntityType<?>>getEntities()Return the metamodel entity types.FilterListenergetFilterListener(java.lang.String tag)Return the filter listener for the given tag, or null if none.java.util.Set<jakarta.persistence.metamodel.ManagedType<?>>getManagedTypes()Return the metamodel managed types.static jakarta.persistence.metamodel.Type.PersistenceTypegetPersistenceType(ClassMetaData meta)QueryContextgetQueryContext()TheQueryContextfor which this resolver was createdMetaDataRepositorygetRepository()<X> jakarta.persistence.metamodel.Type<X>getType(java.lang.Class<X> cls)Return the type representing the basic, entity, mapped superclass, or embeddable class.<X> jakarta.persistence.metamodel.ManagedType<X>managedType(java.lang.Class<X> clazz)Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.<X> voidpopulate(AbstractManagedType<X> type)Populate the static fields of the canonical type.<T> java.util.Set<T>unmodifiableSet(java.util.Collection<T> coll)
-
-
-
Constructor Detail
-
MetamodelImpl
public MetamodelImpl(MetaDataRepository repos)
Constructs a model with the current content of the supplied non-null repository.
-
-
Method Detail
-
getRepository
public MetaDataRepository getRepository()
-
embeddable
public <X> jakarta.persistence.metamodel.EmbeddableType<X> embeddable(java.lang.Class<X> clazz)
Return the metamodel embeddable type representing the embeddable class.- Specified by:
embeddablein interfacejakarta.persistence.metamodel.Metamodel- Parameters:
cls- the type of the represented embeddable class- Returns:
- the metamodel embeddable type
- Throws:
java.lang.IllegalArgumentException- if not an embeddable class
-
entity
public <X> jakarta.persistence.metamodel.EntityType<X> entity(java.lang.Class<X> clazz)
Return the metamodel entity type representing the entity.- Specified by:
entityin interfacejakarta.persistence.metamodel.Metamodel- Parameters:
cls- the type of the represented entity- Returns:
- the metamodel entity type
- Throws:
java.lang.IllegalArgumentException- if not an entity
-
entityImpl
public <X> jakarta.persistence.metamodel.EntityType<X> entityImpl(java.lang.Class<X> clazz)
-
getEmbeddables
public java.util.Set<jakarta.persistence.metamodel.EmbeddableType<?>> getEmbeddables()
Return the metamodel embeddable types.- Specified by:
getEmbeddablesin interfacejakarta.persistence.metamodel.Metamodel- Returns:
- the metamodel embeddable types
-
getEntities
public java.util.Set<jakarta.persistence.metamodel.EntityType<?>> getEntities()
Return the metamodel entity types.- Specified by:
getEntitiesin interfacejakarta.persistence.metamodel.Metamodel- Returns:
- the metamodel entity types
-
getManagedTypes
public java.util.Set<jakarta.persistence.metamodel.ManagedType<?>> getManagedTypes()
Return the metamodel managed types.- Specified by:
getManagedTypesin interfacejakarta.persistence.metamodel.Metamodel- Returns:
- the metamodel managed types
-
managedType
public <X> jakarta.persistence.metamodel.ManagedType<X> managedType(java.lang.Class<X> clazz)
Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.- Specified by:
managedTypein interfacejakarta.persistence.metamodel.Metamodel- Parameters:
cls- the type of the represented managed class- Returns:
- the metamodel managed type
- Throws:
java.lang.IllegalArgumentException- if not a managed class
-
getType
public <X> jakarta.persistence.metamodel.Type<X> getType(java.lang.Class<X> cls)
Return the type representing the basic, entity, mapped superclass, or embeddable class. This method differs from #type(Class) as it also creates a basic or pesudo type for the given class argument if not already available in this receiver.- Parameters:
cls- the type of the represented managed class- Returns:
- the metamodel managed type
- Throws:
java.lang.IllegalArgumentException- if not a managed class
-
getPersistenceType
public static jakarta.persistence.metamodel.Type.PersistenceType getPersistenceType(ClassMetaData meta)
-
unmodifiableSet
public <T> java.util.Set<T> unmodifiableSet(java.util.Collection<T> coll)
-
populate
public <X> void populate(AbstractManagedType<X> type)
Populate the static fields of the canonical type.
-
classForName
public java.lang.Class classForName(java.lang.String name, java.lang.String[] imports)Description copied from interface:ResolverResolve the type represented by the given class name. This will test the type against the namespace of the Query and the declared imports, and will properly handle primitives and java.lang types as well. Returns null if the name does not match a known type.- Specified by:
classForNamein interfaceResolver
-
getAggregateListener
public AggregateListener getAggregateListener(java.lang.String tag)
Description copied from interface:ResolverReturn the function listener for the given tag, or null if none.- Specified by:
getAggregateListenerin interfaceResolver
-
getConfiguration
public OpenJPAConfiguration getConfiguration()
Description copied from interface:ResolverReturn the OpenJPA configuration.- Specified by:
getConfigurationin interfaceResolver
-
getFilterListener
public FilterListener getFilterListener(java.lang.String tag)
Description copied from interface:ResolverReturn the filter listener for the given tag, or null if none.- Specified by:
getFilterListenerin interfaceResolver
-
getQueryContext
public QueryContext getQueryContext()
Description copied from interface:ResolverTheQueryContextfor which this resolver was created- Specified by:
getQueryContextin interfaceResolver
-
-