public class MetamodelImpl extends Object implements javax.persistence.metamodel.Metamodel
| Constructor and Description |
|---|
MetamodelImpl(EntityManagerFactoryImpl entityManagerFactory,
JdbcAdaptor jdbcAdaptor,
MetadataImpl metadata) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSequenceGenerator(SequenceGeneratorMetadata metadata)
Adds the sequence generator to the metamodel
|
void |
addTableGenerator(TableGeneratorMetadata metadata)
Adds the sequence generator to the metamodel
|
<T> BasicTypeImpl<T> |
createBasicType(Class<T> clazz)
Creates of returns an existing
BasicTypeImpl of clazz |
void |
dropAllTables(DataSource datasource)
Drops all the tables in the database.
|
<X> EmbeddableTypeImpl<X> |
embeddable(Class<X> clazz) |
<X> EntityTypeImpl<X> |
entity(Class<X> clazz) |
<X> EntityTypeImpl<X> |
entity(String name)
Returns the entity by name.
|
void |
fireCallbacks(Object instance,
EntityListenerMetadata.EntityListenerType type)
Fires the callbacks.
|
CallbackManager |
getCallbackManager()
Returns the callback manager of the metamodel.
|
Set<javax.persistence.metamodel.EmbeddableType<?>> |
getEmbeddables() |
Set<javax.persistence.metamodel.EntityType<?>> |
getEntities() |
EntityTypeImpl<?> |
getEntity(Class<?> clazz)
Returns the entity that corresponds to clazz's parant chain.
|
EntityManagerFactoryImpl |
getEntityManagerFactory()
Returns the entity manager factory.
|
Set<javax.persistence.metamodel.IdentifiableType<?>> |
getIdentifiables()
Returns the identifiable types.
|
JdbcAdaptor |
getJdbcAdaptor()
Returns the JDBC Adaptor.
|
Set<javax.persistence.metamodel.ManagedType<?>> |
getManagedTypes() |
Collection<NamedQueryMetadata> |
getNamedQueries()
Returns the set of named queries.
|
Long |
getNextSequence(String generator)
Returns the next sequence for the generator.
|
Long |
getNextTableValue(String generator)
Returns the next table value for the generator.
|
<X> EmbeddableTypeImpl<X> |
idClass(Class<X> clazz)
Returns the id class for the
clazz. |
<X> ManagedTypeImpl<X> |
managedType(Class<X> clazz) |
void |
performForeignKeysDdl(DataSource datasource,
DDLMode ddlMode,
EntityTypeImpl<?> entity)
Performs the foreign key DDL operations.
|
void |
performSequencesDdl(DataSource datasource,
DDLMode ddlMode)
Performs the sequence generators DDL operations.
|
void |
performTableGeneratorsDdl(DataSource datasource,
DDLMode ddlMode)
Performs the table generator DDL operations.
|
void |
performTablesDdl(DataSource datasource,
DDLMode ddlMode,
EntityTypeImpl<?> entity)
Performs the table DDL operations.
|
void |
preFillGenerators(DataSource datasource)
Prefills the id generators.
|
void |
stopIdGenerators()
Stops the id generators.
|
<X> TypeImpl<X> |
type(Class<X> clazz)
Returns the type corresponding to the
clazz. |
CallbackAvailability |
updateAvailability(CallbackAvailability availability)
Updates the callback availability.
|
public MetamodelImpl(EntityManagerFactoryImpl entityManagerFactory, JdbcAdaptor jdbcAdaptor, MetadataImpl metadata)
entityManagerFactory - the entity manager factoryjdbcAdaptor - the JDBC Adaptormetadata - the metadatapublic void addSequenceGenerator(SequenceGeneratorMetadata metadata)
metadata - the generator metadatapublic void addTableGenerator(TableGeneratorMetadata metadata)
metadata - the generator metadatapublic <T> BasicTypeImpl<T> createBasicType(Class<T> clazz)
BasicTypeImpl of clazzT - the java type of the basic typeclazz - the classpublic void dropAllTables(DataSource datasource)
datasource - the datasourcepublic <X> EmbeddableTypeImpl<X> embeddable(Class<X> clazz)
embeddable in interface javax.persistence.metamodel.Metamodelpublic <X> EntityTypeImpl<X> entity(Class<X> clazz)
entity in interface javax.persistence.metamodel.Metamodelpublic <X> EntityTypeImpl<X> entity(String name)
X - the type of the entityname - the simple or fully qualified name of the entity.public void fireCallbacks(Object instance, EntityListenerMetadata.EntityListenerType type)
instance - the instancetype - the typepublic CallbackManager getCallbackManager()
public Set<javax.persistence.metamodel.EmbeddableType<?>> getEmbeddables()
getEmbeddables in interface javax.persistence.metamodel.Metamodelpublic Set<javax.persistence.metamodel.EntityType<?>> getEntities()
getEntities in interface javax.persistence.metamodel.Metamodelpublic EntityTypeImpl<?> getEntity(Class<?> clazz)
clazz - the classpublic EntityManagerFactoryImpl getEntityManagerFactory()
public Set<javax.persistence.metamodel.IdentifiableType<?>> getIdentifiables()
public JdbcAdaptor getJdbcAdaptor()
public Set<javax.persistence.metamodel.ManagedType<?>> getManagedTypes()
getManagedTypes in interface javax.persistence.metamodel.Metamodelpublic Collection<NamedQueryMetadata> getNamedQueries()
public Long getNextSequence(String generator)
generator - the generatorpublic Long getNextTableValue(String generator)
generator - the generatorpublic <X> EmbeddableTypeImpl<X> idClass(Class<X> clazz)
clazz.X - the type of the idClassclazz - the class of the idClassclazzpublic <X> ManagedTypeImpl<X> managedType(Class<X> clazz)
managedType in interface javax.persistence.metamodel.Metamodelpublic void performForeignKeysDdl(DataSource datasource, DDLMode ddlMode, EntityTypeImpl<?> entity)
datasource - the datasourceddlMode - the DDL Modeentity - the entity to perform DDL againstBatooException - thrown in case of an underlying exceptionpublic void performSequencesDdl(DataSource datasource, DDLMode ddlMode)
datasource - the datasourceddlMode - the DDL Modepublic void performTableGeneratorsDdl(DataSource datasource, DDLMode ddlMode)
datasource - the datasourceddlMode - the DDL Modepublic void performTablesDdl(DataSource datasource, DDLMode ddlMode, EntityTypeImpl<?> entity)
datasource - the datasourceddlMode - the DDL Modeentity - the entity to perform DDL againstBatooException - thrown in case of an underlying exceptionpublic void preFillGenerators(DataSource datasource)
datasource - the datasource to usepublic void stopIdGenerators()
public <X> TypeImpl<X> type(Class<X> clazz)
clazz.X - the expected type of the typeclazz - the class of the typepublic CallbackAvailability updateAvailability(CallbackAvailability availability)
availability - the callback availabilityCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.