Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata

public Class MetadataProject

extends Object
Class Inheritance
Static Imports
org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_EMBEDDABLE

INTERNAL: A MetadataProject stores metadata and also helps to facilitate the metadata processing. Key notes: - Care should be taken when using Sets to hold metadata and checking their equality. In most cases you should be able to us a List or Map since most additions to those lists should not occur multiple times for the same object. Just be aware of what you are gathering and how. For example, for ClassAccessors, they can always be stored in a map keyed on accessor.getJavaClassName(). List of mapping accessors is ok as well since in most cases we check isProcessed() before calling process on them etc. - methods should be preserved in alphabetical order.
Author
Guy Pelletier
Since
TopLink EJB 3.0 Reference Implementation

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
private List<ClassAccessor>
private Map<String, ClassAccessor>
private Map<String, ClassAccessor>
private Map<String, ConverterAccessor>
private Map<String, ComplexTypeMetadata>
private MetadataProcessor
private Map<String, ConverterAccessor>
private Map<String, AbstractConverterMetadata>
private Set<EntityListenerMetadata>
private List<DirectCollectionAccessor>
private Map<String, EmbeddableAccessor>
private List<MappingAccessor>
private Map<String, EntityAccessor>
private Map<String, XMLEntityMappings>
private boolean
private Map<MetadataClass, GeneratedValueMetadata>
private Set<String>
private Map<String, InterfaceAccessor>
private Set<String>
private boolean
private boolean
private boolean
private boolean
private MetadataLogger
private Map<String, MappedSuperclassAccessor>
private Map<String, MappedSuperclassAccessor>
private boolean
private boolean
private List<RelationshipAccessor>
private List<RelationshipAccessor>
private Map<String, AbstractPartitioningMetadata>
private PersistenceUnitInfo
private XMLPersistenceUnitMetadata
private Map<String, NamedQueryMetadata>
private Map<String, EmbeddableAccessor>
private Map<String, SequenceGeneratorMetadata>
private AbstractSession
private SharedCacheMode
private Map<String, SQLResultSetMappingMetadata>
private Map<String, TableGeneratorMetadata>
private Map<String, UuidGeneratorMetadata>
private Map<String, ClassAccessor>

Constructor Summary

AccessConstructor and Description
public
MetadataProject(PersistenceUnitInfo
- the PersistenceUnitInfo
puInfo
,
AbstractSession
- the Session
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.

Method Summary

Modifier and TypeMethod and Description
protected void
addAccessor(ClassAccessor accessor)

INTERNAL: This method will add the descriptor to the actual EclipseLink project, if it has not already been added.

public void
public void
public void
addAlias(String alias, MetadataDescriptor descriptor)

INTERNAL:

public void
addComplexMetadataType(ComplexTypeMetadata type)

INTERNAL: Add the named PLSQL or Oracle complex metadata type.

public void
addConverter(AbstractConverterMetadata converter)

INTERNAL: Add a abstract converter metadata to the project.

public void
addConverterAccessor(ConverterAccessor converterAccessor)

INTERNAL: Add a abstract converter metadata to the project.

public void
addDefaultListener(EntityListenerMetadata defaultListener)

INTERNAL:

public void
addDirectCollectionAccessor(MappingAccessor accessor)

INTERNAL: Store basic collection accessors for later processing and quick look up.

public void
addEmbeddableAccessor(EmbeddableAccessor accessor)

INTERNAL: Add an embeddable accessor to this project.

public void
public void
addEntityAccessor(EntityAccessor accessor)

INTERNAL: Add an entity accessor to this project.

public void
addEntityGraph(AttributeGroup entityGraph)

INTERNAL: Add the given entity graph (internal attribute group).

public void
addEntityMappings(XMLEntityMappings entityMappings)

INTERNAL: The avoid processing the same mapping file twice (e.g. user may explicitly specify the orm.xml file) we store the list of entity mappings in a map keyed on their URL.

public void
addGeneratedValue(GeneratedValueMetadata generatedvalue, MetadataClass entityClass)

INTERNAL:

public void
addIdClass(String idClassName)

INTERNAL: Add EmbeddedId and IdClass ids to the project

public void
addInterfaceAccessor(InterfaceAccessor accessor)

INTERNAL: Add a InterfaceAccessor to this project.

public void
addMappedSuperclass(MappedSuperclassAccessor mappedSuperclass)

INTERNAL: Add a mapped superclass accessor to this project.

public void
addMetamodelMappedSuperclass(MappedSuperclassAccessor
- The mappedSuperclass accessor for the field on the mappedSuperclass
accessor
,
MetadataDescriptor childDescriptor)

INTERNAL: The metamodel API requires that descriptors exist for mappedSuperclasses in order to obtain their mappings.

public void
addPartitioningPolicy(AbstractPartitioningMetadata policy)

INTERNAL: Add the partitioning policy by name.

public void
addQuery(NamedQueryMetadata query)

INTERNAL: Add a query to the project overriding where necessary.

public void
public void
addRootEmbeddableAccessor(EmbeddableAccessor accessor)

INTERNAL: Add a root level embeddable accessor.

public void
addSequenceGenerator(SequenceGeneratorMetadata sequenceGenerator, String defaultCatalog, String defaultSchema)

INTERNAL: Add a sequence generator metadata to the project.

public void
addSQLResultSetMapping(SQLResultSetMappingMetadata sqlResultSetMapping)

INTERNAL: Add an sql results set mapping to the project overriding where necessary.

public void
addStaticMetamodelClass(MetadataAnnotation annotation, MetadataClass metamodelClass)

INTERNAL: Add a discovered metamodel class to the session.

public void
addTableGenerator(TableGeneratorMetadata tableGenerator, String defaultCatalog, String defaultSchema)

INTERNAL: Add a table generator metadata to the project.

public void
addUuidGenerator(UuidGeneratorMetadata uuidGenerator)

INTERNAL: Add a UUID generator metadata to the project.

public void
addVirtualClass(ClassAccessor accessor)

INTERNAL: Add virtual class accessor to the project.

protected void
createDynamicClass(MetadataDescriptor descriptor, Map<String, MetadataDescriptor> virtualEntities, DynamicClassLoader dcl)

INTERNAL: Create the dynamic class using JPA metadata processed descriptors.

public void
createDynamicClasses(ClassLoader loader)

INTERNAL: Create the dynamic class using JPA metadata processed descriptors.

protected void
createDynamicType(MetadataDescriptor descriptor, Map<String, DynamicType> dynamicTypes, DynamicClassLoader dcl)

INTERNAL: Create the dynamic types using JPA metadata processed descriptors.

private void
public void
disableWeaving()

INTERNAL: Set if the project should use indirection for lazy relationships.

public boolean
excludeDefaultMappings()

INTERNAL: Return true if an exclude-default-mappings setting have been set for this persistence unit.

public ClassAccessor
getAccessor(String className)

INTERNAL: Return the accessor for the given class.

public List<ClassAccessor>
public Collection<ClassAccessor>
getAllAccessors()

INTERNAL:

public ConverterAccessor
getAutoApplyConverter(MetadataClass cls)

Return the converter for the auto apply class type.

public ComplexTypeMetadata
getComplexTypeMetadata(String name)

INTERNAL: Return the named PLSQL or Oracle complex metadata type.

public MetadataProcessor
public AbstractConverterMetadata
getConverter(String name)

INTERNAL:

public ConverterAccessor
public Map<String, ConverterAccessor>
public Set<EntityListenerMetadata>
public EmbeddableAccessor
getEmbeddableAccessor(MetadataClass cls)

INTERNAL: This method will attempt to look up the embeddable accessor for the reference class provided.

public EmbeddableAccessor
getEmbeddableAccessor(MetadataClass cls, boolean checkIsIdClass)

INTERNAL: This method will attempt to look up the embeddable accessor for the reference class provided.

public EmbeddableAccessor
getEmbeddableAccessor(String className)

INTERNAL: Return the embeddable accessor with the given classname.

public Collection<EmbeddableAccessor>
getEmbeddableAccessors()

INTERNAL: Return the embeddable accessor with the given classname.

public EntityAccessor
getEntityAccessor(MetadataClass cls)

INTERNAL: Return the entity accessor for the given class name.

public EntityAccessor
getEntityAccessor(String className)

INTERNAL: Return the entity accessor for the given class name.

public Collection<EntityAccessor>
getEntityAccessors()

INTERNAL:

public Collection<XMLEntityMappings>
getEntityMappings()

INTERNAL:

public InterfaceAccessor
getInterfaceAccessor(String className)

INTERNAL: Return the entity accessor for the given class.

public MetadataLogger
getLogger()

INTERNAL: Return the logger used by the processor.

public MappedSuperclassAccessor
public MappedSuperclassAccessor
getMappedSuperclassAccessor(String className)

INTERNAL:

public Collection<MappedSuperclassAccessor>
public Collection<MappedSuperclassAccessor>
getMetamodelMappedSuperclasses()

INTERNAL: Returns the collection of metamodel MappedSuperclassAccessors.

public AbstractPartitioningMetadata
getPartitioningPolicy(String name)

INTERNAL: Return the named partitioning policy.

protected String
getPersistenceUnitDefaultCatalog()

INTERNAL: Return the persistence unit default catalog.

protected String
getPersistenceUnitDefaultSchema()

INTERNAL: Return the persistence unit default schema.

public PersistenceUnitInfo
public XMLPersistenceUnitMetadata
public Project
getProject()

INTERNAL: Return the core API Project associated with this MetadataProject.

public Collection<EmbeddableAccessor>
getRootEmbeddableAccessors()

INTERNAL: Add a root level embeddable accessor.

public AbstractSession
getSession()

INTERNAL:

protected String
getSharedCacheModeName()

INTERNAL: This method will return the name of the SharedCacheMode if specified in the persistence.xml file.

public boolean
getShouldForceFieldNamesToUpperCase()

INTERNAL: Used to uppercase default and user defined column field names

public List<StructConverterMetadata>
public Collection<String>
getWeavableClassNames()

INTERNAL: Returns all those classes in this project that are available for weaving.

public boolean
hasAutoApplyConverter(MetadataClass cls)

Return true if there is an auto-apply converter for the given cls.

public boolean
hasConverter(String name)

INTERNAL:

public boolean
public boolean
public boolean
hasEmbeddable(String className)

INTERNAL:

public boolean
hasEntity(MetadataClass cls)

INTERNAL:

public boolean
hasEntity(String className)

INTERNAL:

public boolean
hasEntityGraph(String name)

INTERNAL: Return true is there exist and entity graph already for the given name.

public boolean
hasEntityThatImplementsInterface(String interfaceName)

INTERNAL:

public boolean
public boolean
public boolean
hasMappedSuperclass(String className)

INTERNAL:

public boolean
hasSharedCacheMode()

INTERNAL:

public boolean
hasVirtualClasses()

INTERNAL: Return true if the entity manager factory for this project has any virtual classes

public boolean
isIdClass(MetadataClass idClass)

INTERNAL:

public boolean
isSharedCacheModeAll()

INTERNAL: Return true if the caching has been specified as ALL in the persistence.xml.

public boolean
isSharedCacheModeDisableSelective()

INTERNAL: Return true if the caching has been specified as DISABLE_SELECTIVE in the persistence.xml.

public boolean
isSharedCacheModeEnableSelective()

INTERNAL: Return true if the caching has been specified as ENABLE_SELECTIVE in the persistence.xml.

public boolean
isSharedCacheModeNone()

INTERNAL: Return true if the caching has been specified as NONE in the persistence.xml.

public boolean
isSharedCacheModeUnspecified()

INTERNAL: Return true if the caching has been specified as UNSPECIFIED in the persistence.xml.

public boolean
isWeavingEagerEnabled()

INTERNAL: Return if the project should use indirection for eager relationships.

public boolean
isWeavingFetchGroupsEnabled()

INTERNAL: Return if the project should process fetch groups.

public boolean
isWeavingLazyEnabled()

INTERNAL: Return if the project should use indirection for lazy relationships.

public boolean
isXMLMappingMetadataComplete()

INTERNAL: Return true if an xml-mapping-metadata-complete setting has been set for this persistence unit.

protected void
processAccessorsWithDerivedIDs()

INTERNAL: Process descriptors with IDs derived from relationships.

public void
processDirectCollectionAccessors()

INTERNAL: Process any BasicCollection annotation and/or BasicMap annotation that were found.

protected void
processEmbeddableMappingAccessors()

INTERNAL: Process the embeddable mapping accessors.

protected void
processInterfaceAccessors()

INTERNAL: This method will iterate through all the entities in the PU and check if we should add them to a variable one to one mapping that was either defined (incompletely) or defaulted.

protected void
processNonOwningRelationshipAccessors()

INTERNAL: Process the non-owning relationship accessors.

protected void
processOwningRelationshipAccessors()

INTERNAL: Process the owning relationship accessors.

protected void
processPartitioning()

Process the partitioning metedata and add the PartitioningPolicys to the project.

protected void
processPersistenceUnitMetadata(MetadataDescriptor descriptor)

INTERNAL: Process any and all persistence unit metadata and defaults to the given descriptor.

public void
processQueries()

INTERNAL: Process the named native queries we found and add them to the given session.

protected void
processSequencingAccessors()

INTERNAL: Process the sequencing information.

public 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.

public void
processStage2()

INTERNAL: Stage 2 processing will perform the following tasks: - process all direct mapping accessors from entities, embeddables and mapped superclasses.

public 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.

public void
processTable(TableMetadata table, String defaultName, String defaultCatalog, String defaultSchema, ORMetadata owner)

INTERNAL: Common table processing for table, secondary table, join table, collection table and table generators

public void
removeEmbeddableAccessor(MetadataClass metadataClass)

INTERNAL: Used from the canonical model generator.

public void
removeEntityAccessor(MetadataClass metadataClass)

INTERNAL: Used from the canonical model generator.

public void
removeMappedSuperclassAccessor(MetadataClass metadataClass)

INTERNAL: Used from the canonical model generator.

private String
public void
setAllowNativeSQLQueries(boolean allowNativeSQLQueries)

INTERNAL: When at least one entity is found that is multitenant, we turn off native SQL queries.

public void
setCompositeProcessor(MetadataProcessor compositeProcessor)

INTERNAL: set compositeProcessor that owns this and pear MetadataProcessors used to create composite persistence unit.

public void
setPersistenceUnitMetadata(XMLPersistenceUnitMetadata persistenceUnitMetadata)

INTERNAL:

public void
setSharedCacheMode(SharedCacheMode m_sharedCacheMode)

INTERNAL: Sets the SharedCacheMode value.

public void
setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)

INTERNAL: Used to uppercase default and user defined column field names

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
public boolean
public boolean
usesMultitenantSharedCache()

INTERNAL: Return true if the entity manager factory cache for this project is intended to be shared amongst multitenants.

public boolean
usesMultitenantSharedEmf()

INTERNAL: Return true if the entity manager factory for this project is intended to be shared amongst multitenants.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait