public class MetadataProject
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_AUTO_GENERATOR |
static java.lang.String |
DEFAULT_IDENTITY_GENERATOR |
static java.lang.String |
DEFAULT_SEQUENCE_GENERATOR |
static java.lang.String |
DEFAULT_TABLE_GENERATOR |
Constructor and Description |
---|
MetadataProject(javax.persistence.spi.PersistenceUnitInfo puInfo,
AbstractSession session,
boolean weaveLazy,
boolean weaveEager,
boolean weaveFetchGroups,
boolean multitenantSharedEmf,
boolean multitenantSharedCache)
INTERNAL:
Create and return a new MetadataProject with puInfo as its PersistenceUnitInfo,
session as its Session and weavingEnabled as its global dynamic weaving state.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessorWithCustomizer(ClassAccessor accessor)
INTERNAL:
|
void |
addAccessorWithDerivedId(ClassAccessor accessor)
INTERNAL:
|
void |
addAlias(java.lang.String alias,
MetadataDescriptor descriptor)
INTERNAL:
|
void |
addComplexMetadataType(ComplexTypeMetadata type)
INTERNAL:
Add the named PLSQL or Oracle complex metadata type.
|
void |
addConverter(AbstractConverterMetadata converter)
INTERNAL:
Add a abstract converter metadata to the project.
|
void |
addConverterAccessor(ConverterAccessor converterAccessor)
INTERNAL:
Add a abstract converter metadata to the project.
|
void |
addDefaultListener(EntityListenerMetadata defaultListener)
INTERNAL:
|
void |
addDirectCollectionAccessor(MappingAccessor accessor)
INTERNAL:
Store basic collection accessors for later processing and quick look up.
|
void |
addEmbeddableAccessor(EmbeddableAccessor accessor)
INTERNAL:
Add an embeddable accessor to this project.
|
void |
addEmbeddableMappingAccessor(MappingAccessor accessor)
INTERNAL:
|
void |
addEntityAccessor(EntityAccessor accessor)
INTERNAL:
Add an entity accessor to this project.
|
void |
addEntityGraph(AttributeGroup entityGraph)
INTERNAL:
Add the given entity graph (internal attribute group).
|
void |
addEntityMappings(XMLEntityMappings entityMappings)
INTERNAL:
The avoid processing the same mapping file twice (e.g.
|
void |
addGeneratedValue(GeneratedValueMetadata generatedvalue,
MetadataClass entityClass)
INTERNAL:
|
void |
addIdClass(java.lang.String idClassName)
INTERNAL:
Add EmbeddedId and IdClass ids to the project
|
void |
addInterfaceAccessor(InterfaceAccessor accessor)
INTERNAL:
Add a InterfaceAccessor to this project.
|
void |
addMappedSuperclass(MappedSuperclassAccessor mappedSuperclass)
INTERNAL:
Add a mapped superclass accessor to this project.
|
void |
addMetamodelMappedSuperclass(MappedSuperclassAccessor accessor,
MetadataDescriptor childDescriptor)
INTERNAL:
The metamodel API requires that descriptors exist for mappedSuperclasses
in order to obtain their mappings.
|
void |
addPartitioningPolicy(AbstractPartitioningMetadata policy)
INTERNAL:
Add the partitioning policy by name.
|
void |
addQuery(NamedQueryMetadata query)
INTERNAL:
Add a query to the project overriding where necessary.
|
void |
addRelationshipAccessor(RelationshipAccessor accessor)
INTERNAL:
|
void |
addRootEmbeddableAccessor(EmbeddableAccessor accessor)
INTERNAL:
Add a root level embeddable accessor.
|
void |
addSequenceGenerator(SequenceGeneratorMetadata sequenceGenerator,
java.lang.String defaultCatalog,
java.lang.String defaultSchema)
INTERNAL:
Add a sequence generator metadata to the project.
|
void |
addSQLResultSetMapping(SQLResultSetMappingMetadata sqlResultSetMapping)
INTERNAL:
Add an sql results set mapping to the project overriding where necessary.
|
void |
addStaticMetamodelClass(MetadataAnnotation annotation,
MetadataClass metamodelClass)
INTERNAL:
Add a discovered metamodel class to the session.
|
void |
addTableGenerator(TableGeneratorMetadata tableGenerator,
java.lang.String defaultCatalog,
java.lang.String defaultSchema)
INTERNAL:
Add a table generator metadata to the project.
|
void |
addUuidGenerator(UuidGeneratorMetadata uuidGenerator)
INTERNAL:
Add a UUID generator metadata to the project.
|
void |
addVirtualClass(ClassAccessor accessor)
INTERNAL:
Add virtual class accessor to the project.
|
void |
createDynamicClasses(java.lang.ClassLoader loader)
INTERNAL:
Create the dynamic class using JPA metadata processed descriptors.
|
void |
createRestInterfaces(java.lang.ClassLoader loader) |
void |
disableWeaving()
INTERNAL:
Set if the project should use indirection for lazy relationships.
|
boolean |
excludeDefaultMappings()
INTERNAL:
Return true if an exclude-default-mappings setting have been set for this
persistence unit.
|
ClassAccessor |
getAccessor(java.lang.String className)
INTERNAL:
Return the accessor for the given class.
|
java.util.List<ClassAccessor> |
getAccessorsWithCustomizer()
INTERNAL:
|
java.util.Collection<ClassAccessor> |
getAllAccessors()
INTERNAL:
|
ConverterAccessor |
getAutoApplyConverter(MetadataClass cls)
Return the converter for the auto apply class type.
|
ComplexTypeMetadata |
getComplexTypeMetadata(java.lang.String name)
INTERNAL:
Return the named PLSQL or Oracle complex metadata type.
|
MetadataProcessor |
getCompositeProcessor()
INTERNAL:
|
AbstractConverterMetadata |
getConverter(java.lang.String name)
INTERNAL:
|
ConverterAccessor |
getConverterAccessor(MetadataClass cls)
INTERNAL:
|
java.util.Map<java.lang.String,ConverterAccessor> |
getConverterAccessors()
INTERNAL:
|
java.util.Set<EntityListenerMetadata> |
getDefaultListeners()
INTERNAL:
|
EmbeddableAccessor |
getEmbeddableAccessor(MetadataClass cls)
INTERNAL:
This method will attempt to look up the embeddable accessor for the
reference class provided.
|
EmbeddableAccessor |
getEmbeddableAccessor(MetadataClass cls,
boolean checkIsIdClass)
INTERNAL:
This method will attempt to look up the embeddable accessor for the
reference class provided.
|
EmbeddableAccessor |
getEmbeddableAccessor(java.lang.String className)
INTERNAL:
Return the embeddable accessor with the given classname.
|
java.util.Collection<EmbeddableAccessor> |
getEmbeddableAccessors()
INTERNAL:
Return the embeddable accessor with the given classname.
|
EntityAccessor |
getEntityAccessor(MetadataClass cls)
INTERNAL:
Return the entity accessor for the given class name.
|
EntityAccessor |
getEntityAccessor(java.lang.String className)
INTERNAL:
Return the entity accessor for the given class name.
|
java.util.Collection<EntityAccessor> |
getEntityAccessors()
INTERNAL:
|
java.util.Collection<XMLEntityMappings> |
getEntityMappings()
INTERNAL:
|
InterfaceAccessor |
getInterfaceAccessor(java.lang.String className)
INTERNAL:
Return the entity accessor for the given class.
|
MetadataLogger |
getLogger()
INTERNAL:
Return the logger used by the processor.
|
MappedSuperclassAccessor |
getMappedSuperclassAccessor(MetadataClass cls)
INTERNAL:
|
MappedSuperclassAccessor |
getMappedSuperclassAccessor(java.lang.String className)
INTERNAL:
|
java.util.Collection<MappedSuperclassAccessor> |
getMappedSuperclasses()
INTERNAL:
|
java.util.Collection<MappedSuperclassAccessor> |
getMetamodelMappedSuperclasses()
INTERNAL:
Returns the collection of metamodel MappedSuperclassAccessors.
|
AbstractPartitioningMetadata |
getPartitioningPolicy(java.lang.String name)
INTERNAL:
Return the named partitioning policy.
|
javax.persistence.spi.PersistenceUnitInfo |
getPersistenceUnitInfo()
INTERNAL:
|
XMLPersistenceUnitMetadata |
getPersistenceUnitMetadata()
INTERNAL:
|
Project |
getProject()
INTERNAL:
Return the core API Project associated with this MetadataProject.
|
java.util.Collection<EmbeddableAccessor> |
getRootEmbeddableAccessors()
INTERNAL:
Add a root level embeddable accessor.
|
AbstractSession |
getSession()
INTERNAL:
|
boolean |
getShouldForceFieldNamesToUpperCase()
INTERNAL:
Used to uppercase default and user defined column field names
|
java.util.List<StructConverterMetadata> |
getStructConverters()
INTERNAL:
|
java.util.Collection<java.lang.String> |
getWeavableClassNames()
INTERNAL:
Returns all those classes in this project that are available for
weaving.
|
boolean |
hasAutoApplyConverter(MetadataClass cls)
Return true if there is an auto-apply converter for the given cls.
|
boolean |
hasConverter(java.lang.String name)
INTERNAL:
|
boolean |
hasConverterAccessor(MetadataClass cls)
INTERNAL:
|
boolean |
hasEmbeddable(MetadataClass cls)
INTERNAL:
|
boolean |
hasEmbeddable(java.lang.String className)
INTERNAL:
|
boolean |
hasEntity(MetadataClass cls)
INTERNAL:
|
boolean |
hasEntity(java.lang.String className)
INTERNAL:
|
boolean |
hasEntityGraph(java.lang.String name)
INTERNAL:
Return true is there exist and entity graph already for the given name.
|
boolean |
hasEntityThatImplementsInterface(java.lang.String interfaceName)
INTERNAL:
|
boolean |
hasInterface(MetadataClass cls)
INTERNAL:
|
boolean |
hasMappedSuperclass(MetadataClass cls)
INTERNAL:
|
boolean |
hasMappedSuperclass(java.lang.String className)
INTERNAL:
|
boolean |
hasSharedCacheMode()
INTERNAL:
|
boolean |
hasVirtualClasses()
INTERNAL:
Return true if the entity manager factory for this project has any virtual classes
|
boolean |
isIdClass(MetadataClass idClass)
INTERNAL:
|
boolean |
isSharedCacheModeAll()
INTERNAL:
Return true if the caching has been specified as ALL in the
persistence.xml.
|
boolean |
isSharedCacheModeDisableSelective()
INTERNAL:
Return true if the caching has been specified as DISABLE_SELECTIVE in the
persistence.xml.
|
boolean |
isSharedCacheModeEnableSelective()
INTERNAL:
Return true if the caching has been specified as ENABLE_SELECTIVE in the
persistence.xml.
|
boolean |
isSharedCacheModeNone()
INTERNAL:
Return true if the caching has been specified as NONE in the
persistence.xml.
|
boolean |
isSharedCacheModeUnspecified()
INTERNAL:
Return true if the caching has been specified as UNSPECIFIED in the
persistence.xml.
|
boolean |
isWeavingEagerEnabled()
INTERNAL:
Return if the project should use indirection for eager relationships.
|
boolean |
isWeavingFetchGroupsEnabled()
INTERNAL:
Return if the project should process fetch groups.
|
boolean |
isWeavingLazyEnabled()
INTERNAL:
Return if the project should use indirection for lazy relationships.
|
boolean |
isXMLMappingMetadataComplete()
INTERNAL:
Return true if an xml-mapping-metadata-complete setting has been set
for this persistence unit.
|
void |
processDirectCollectionAccessors()
INTERNAL:
Process any BasicCollection annotation and/or BasicMap annotation that
were found.
|
void |
processQueries()
INTERNAL:
Process the named native queries we found and add them to the given
session.
|
void |
processStage1()
INTERNAL:
Stage 1 processing is a pre-processing stage that will perform the
following tasks:
- gather a list of mapping accessors for all entities and embeddables.
|
void |
processStage2()
INTERNAL:
Stage 2 processing will perform the following tasks:
- process all direct mapping accessors from entities, embeddables and
mapped superclasses.
|
void |
processStage3(PersistenceUnitProcessor.Mode mode)
INTERNAL:
Stage 3 processing does all the extra processing that couldn't be
completed in the first two stages of processing.
|
void |
processTable(TableMetadata table,
java.lang.String defaultName,
java.lang.String defaultCatalog,
java.lang.String defaultSchema,
ORMetadata owner)
INTERNAL:
Common table processing for table, secondary table, join table,
collection table and table generators
|
void |
removeEmbeddableAccessor(MetadataClass metadataClass)
INTERNAL:
Used from the canonical model generator.
|
void |
removeEntityAccessor(MetadataClass metadataClass)
INTERNAL:
Used from the canonical model generator.
|
void |
removeMappedSuperclassAccessor(MetadataClass metadataClass)
INTERNAL:
Used from the canonical model generator.
|
void |
setAllowNativeSQLQueries(boolean allowNativeSQLQueries)
INTERNAL:
When at least one entity is found that is multitenant, we turn off
native SQL queries.
|
void |
setCompositeProcessor(MetadataProcessor compositeProcessor)
INTERNAL:
set compositeProcessor that owns this and pear MetadataProcessors used to create composite persistence unit.
|
void |
setPersistenceUnitMetadata(XMLPersistenceUnitMetadata persistenceUnitMetadata)
INTERNAL:
|
void |
setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)
INTERNAL:
Used to uppercase default and user defined column field names
|
java.lang.String |
toString()
INTERNAL:
|
boolean |
useDelimitedIdentifier()
INTERNAL:
|
boolean |
usesMultitenantSharedCache()
INTERNAL:
Return true if the entity manager factory cache for this project is
intended to be shared amongst multitenants.
|
boolean |
usesMultitenantSharedEmf()
INTERNAL:
Return true if the entity manager factory for this project is intended
to be shared amongst multitenants.
|
public static final java.lang.String DEFAULT_AUTO_GENERATOR
public static final java.lang.String DEFAULT_TABLE_GENERATOR
public static final java.lang.String DEFAULT_SEQUENCE_GENERATOR
public static final java.lang.String DEFAULT_IDENTITY_GENERATOR
public MetadataProject(javax.persistence.spi.PersistenceUnitInfo puInfo, AbstractSession session, boolean weaveLazy, boolean weaveEager, boolean weaveFetchGroups, boolean multitenantSharedEmf, boolean multitenantSharedCache)
puInfo
- - the PersistenceUnitInfosession
- - the Sessionpublic void createRestInterfaces(java.lang.ClassLoader loader)
public void addAccessorWithCustomizer(ClassAccessor accessor)
public void addAccessorWithDerivedId(ClassAccessor accessor)
public void addAlias(java.lang.String alias, MetadataDescriptor descriptor)
public void addConverter(AbstractConverterMetadata converter)
public void addConverterAccessor(ConverterAccessor converterAccessor)
public void addDefaultListener(EntityListenerMetadata defaultListener)
public void addDirectCollectionAccessor(MappingAccessor accessor)
public void addEmbeddableAccessor(EmbeddableAccessor accessor)
public void addEmbeddableMappingAccessor(MappingAccessor accessor)
public void addEntityAccessor(EntityAccessor accessor)
public void addEntityGraph(AttributeGroup entityGraph)
public void addEntityMappings(XMLEntityMappings entityMappings)
public void addGeneratedValue(GeneratedValueMetadata generatedvalue, MetadataClass entityClass)
public void addIdClass(java.lang.String idClassName)
public void addInterfaceAccessor(InterfaceAccessor accessor)
public void addMappedSuperclass(MappedSuperclassAccessor mappedSuperclass)
public void addMetamodelMappedSuperclass(MappedSuperclassAccessor accessor, MetadataDescriptor childDescriptor)
In order to accomplish this, this method that is called from EntityAccessor will ensure that the descriptors on all mappedSuperclass accessors are setup so that they can be specially processed later in MetadataProject.processStage2() - where the m_mappedSuperclassAccessors Map is required.
We do not use the non-persisting MAPPED_SUPERCLASS_RESERVED_PK_NAME PK field. Normally when the MappedSuperclass is part of an inheritance hierarchy of the form MS->MS->E, where there is an PK Id on the root Entity E, we need to add the MAPPED_SUPERCLASS_RESERVED_PK_NAME PK field solely for metadata processing to complete. Why? because even though we treat MappedSuperclass objects as a RelationalDescriptor - we only persist RelationalDescriptor objects that relate to concrete Entities.
This method is referenced by EntityAccessor.addPotentialMappedSuperclass() during an initial predeploy() and later during a deploy()
accessor
- - The mappedSuperclass accessor for the field on the mappedSuperclasspublic void addPartitioningPolicy(AbstractPartitioningMetadata policy)
public void addComplexMetadataType(ComplexTypeMetadata type)
public void addQuery(NamedQueryMetadata query)
public void addRelationshipAccessor(RelationshipAccessor accessor)
public void addRootEmbeddableAccessor(EmbeddableAccessor accessor)
public void addSequenceGenerator(SequenceGeneratorMetadata sequenceGenerator, java.lang.String defaultCatalog, java.lang.String defaultSchema)
public void addUuidGenerator(UuidGeneratorMetadata uuidGenerator)
public void addSQLResultSetMapping(SQLResultSetMappingMetadata sqlResultSetMapping)
public void addStaticMetamodelClass(MetadataAnnotation annotation, MetadataClass metamodelClass)
public void addTableGenerator(TableGeneratorMetadata tableGenerator, java.lang.String defaultCatalog, java.lang.String defaultSchema)
public void addVirtualClass(ClassAccessor accessor)
public void createDynamicClasses(java.lang.ClassLoader loader)
public void disableWeaving()
public boolean excludeDefaultMappings()
public ClassAccessor getAccessor(java.lang.String className)
public java.util.List<ClassAccessor> getAccessorsWithCustomizer()
public java.util.Collection<ClassAccessor> getAllAccessors()
public ConverterAccessor getAutoApplyConverter(MetadataClass cls)
public MetadataProcessor getCompositeProcessor()
public AbstractConverterMetadata getConverter(java.lang.String name)
public ConverterAccessor getConverterAccessor(MetadataClass cls)
public java.util.Map<java.lang.String,ConverterAccessor> getConverterAccessors()
public java.util.Set<EntityListenerMetadata> getDefaultListeners()
public EmbeddableAccessor getEmbeddableAccessor(MetadataClass cls)
public EmbeddableAccessor getEmbeddableAccessor(MetadataClass cls, boolean checkIsIdClass)
public EmbeddableAccessor getEmbeddableAccessor(java.lang.String className)
public java.util.Collection<EmbeddableAccessor> getEmbeddableAccessors()
public EntityAccessor getEntityAccessor(MetadataClass cls)
public EntityAccessor getEntityAccessor(java.lang.String className)
public java.util.Collection<EntityAccessor> getEntityAccessors()
public java.util.Collection<XMLEntityMappings> getEntityMappings()
public InterfaceAccessor getInterfaceAccessor(java.lang.String className)
public MetadataLogger getLogger()
public MappedSuperclassAccessor getMappedSuperclassAccessor(MetadataClass cls)
public MappedSuperclassAccessor getMappedSuperclassAccessor(java.lang.String className)
public java.util.Collection<MappedSuperclassAccessor> getMappedSuperclasses()
public java.util.Collection<MappedSuperclassAccessor> getMetamodelMappedSuperclasses()
getMappedSuperclass(MetadataClass)
,
getMappedSuperclass(String)
,
getMappedSuperclasses()
public AbstractPartitioningMetadata getPartitioningPolicy(java.lang.String name)
public javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
public XMLPersistenceUnitMetadata getPersistenceUnitMetadata()
public ComplexTypeMetadata getComplexTypeMetadata(java.lang.String name)
public Project getProject()
public java.util.Collection<EmbeddableAccessor> getRootEmbeddableAccessors()
processStage1()
public AbstractSession getSession()
public boolean getShouldForceFieldNamesToUpperCase()
public java.util.List<StructConverterMetadata> getStructConverters()
public java.util.Collection<java.lang.String> getWeavableClassNames()
public boolean hasAutoApplyConverter(MetadataClass cls)
public boolean hasConverter(java.lang.String name)
public boolean hasConverterAccessor(MetadataClass cls)
public boolean hasEmbeddable(MetadataClass cls)
public boolean hasEmbeddable(java.lang.String className)
public boolean hasEntity(MetadataClass cls)
public boolean hasEntity(java.lang.String className)
public boolean hasEntityGraph(java.lang.String name)
public boolean hasEntityThatImplementsInterface(java.lang.String interfaceName)
public boolean hasInterface(MetadataClass cls)
public boolean hasMappedSuperclass(MetadataClass cls)
public boolean hasMappedSuperclass(java.lang.String className)
public boolean hasSharedCacheMode()
public boolean isIdClass(MetadataClass idClass)
public boolean isSharedCacheModeAll()
public boolean isSharedCacheModeDisableSelective()
public boolean isSharedCacheModeEnableSelective()
public boolean isSharedCacheModeNone()
public boolean isSharedCacheModeUnspecified()
public boolean isWeavingEagerEnabled()
public boolean isWeavingFetchGroupsEnabled()
public boolean isWeavingLazyEnabled()
public boolean isXMLMappingMetadataComplete()
public void processDirectCollectionAccessors()
public void processQueries()
public void processStage1()
processStage2
public void processStage2()
processStage3
public void processStage3(PersistenceUnitProcessor.Mode mode)
public void processTable(TableMetadata table, java.lang.String defaultName, java.lang.String defaultCatalog, java.lang.String defaultSchema, ORMetadata owner)
public void removeEmbeddableAccessor(MetadataClass metadataClass)
public void removeEntityAccessor(MetadataClass metadataClass)
public void removeMappedSuperclassAccessor(MetadataClass metadataClass)
public void setAllowNativeSQLQueries(boolean allowNativeSQLQueries)
public void setCompositeProcessor(MetadataProcessor compositeProcessor)
public void setPersistenceUnitMetadata(XMLPersistenceUnitMetadata persistenceUnitMetadata)
public void setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean useDelimitedIdentifier()
public boolean usesMultitenantSharedCache()
public boolean usesMultitenantSharedEmf()
public boolean hasVirtualClasses()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference