Top Description Fields Constructors Methods
org.eclipse.persistence.sessions

public Class Project

extends CoreProject<ClassDescriptor, Login, DatabaseSession>
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.factories.NamespaceResolvableProject, org.eclipse.persistence.internal.sessions.factories.XMLSessionConfigProject, org.eclipse.persistence.internal.oxm.schema.SchemaModelProject
Imports
java.io.Serializable, java.util.ArrayList, .Collection, .HashMap, .Iterator, .List, .Map, .Vector, org.eclipse.persistence.annotations.IdValidation, org.eclipse.persistence.config.CacheIsolationType, org.eclipse.persistence.core.sessions.CoreProject, org.eclipse.persistence.descriptors.ClassDescriptor, .MultitenantPolicy, org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy, org.eclipse.persistence.internal.helper.ConcurrentFixedCache, .Helper, .NonSynchronizedVector, org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap, .IdentityMap, org.eclipse.persistence.internal.sessions.AbstractSession, .DatabaseSessionImpl, org.eclipse.persistence.queries.AttributeGroup, .DatabaseQuery, .QueryResultsCachePolicy, .SQLResultSetMapping, org.eclipse.persistence.sessions.server.ConnectionPolicy, .Server, .ServerSession

Purpose: Maintain all of the EclipseLink configuration information for a system.

Responsibilities:

See Also
DatabaseLogin

Field Summary

Modifier and TypeField and Description
protected Map<String, ClassDescriptor>
aliasDescriptors

Cache the EJBQL descriptor aliases.

protected boolean
allowExtendedCacheLogging

Flag that allows extended logging of JPA L2 cache or not.

protected boolean
allowExtendedThreadLogging

Flag that allows extended thread logging or not.

protected boolean
allowExtendedThreadLoggingThreadDump

Flag that allows add to extended thread logging output thread stack trace or not.

protected boolean
allowNativeSQLQueries

Flag that allows native queries or not

protected boolean
allowQueryResultsCacheValidation

Flag that allows query result cache validation or not.

protected boolean
allowSQLDeferral

Flag that allows call deferral to be disabled

protected boolean
allowTablePerMultitenantDDLGeneration

Flag that allows DDL generation of table per tenant multitenant descriptors

protected Map<String, AttributeGroup>
attributeGroups

List of named AttributeGroups - once Project is initialized, these are copied to the Session.

protected Collection<String>
classNamesForWeaving

used for Caching JPA projects

protected Login
protected CacheIsolationType
defaultCacheIsolation

Default value for ClassDescriptor.isIsolated.

protected Class<? extends IdentityMap>
defaultIdentityMapClass

Default value for ClassDescriptor.identityMapClass.

protected int
defaultIdentityMapSize

Default value for ClassDescriptor.identityMapSize.

protected IdValidation
defaultIdValidation

Default value for ClassDescriptor.idValidation.

protected QueryResultsCachePolicy
defaultQueryResultsCachePolicy

Default value for query caching options for all named queries.

protected Vector<Class<?>>
defaultReadOnlyClasses

Holds the default set of read-only classes that apply to each UnitOfWork.

protected boolean
defaultTemporalMutable

Define the default setting for configuring if dates and calendars are mutable.

protected Map<Class<?>, ClassDescriptor>
protected Object
descriptorsLock

Ensures that only one thread at a time can add/remove descriptors

protected boolean
hasGenericHistorySupport

Cache if any descriptor has history.

protected boolean
hasIsolatedClasses

Cache if any descriptor is isolated.

protected transient boolean
hasMappingsPostCalculateChangesOnDeleted

Indicates whether there is at least one descriptor that has at least on mapping that require a call on deleted objects to update change sets.

protected boolean
hasNonIsolatedUOWClasses

Cache if all descriptors are isolated in the unit of work.

protected boolean
hasProxyIndirection

Cache if any descriptor is using ProxyIndirection.

protected List<DatabaseQuery>
jpaQueries

List of queries from JPA that need special processing before execution.

protected List<DatabaseQuery>
jpaTablePerTenantQueries

List of queries from JPA that may special processing and handling before execution.

protected transient ConcurrentFixedCache
jpqlParseCache

PERF: Provide an JPQL parse cache to optimize dynamic JPQL.

protected Map<String, ClassDescriptor>
mappedSuperclassDescriptors

Mapped Superclasses (JPA 2) collection of parent non-relational descriptors keyed on MetadataClass without creating a compile time dependency on JPA.

protected Map<String, List<String>>
metamodelIdClassMap

Store the IdClass Id attributes for exclusive use by the Metamodel API Keyed on the fully qualified accessible object owner class name.

protected MultitenantPolicy
protected String
protected boolean
namingIntoIndexed

Flag that allows transform named stored procedure parameters into positional/index based

protected List<ClassDescriptor>
protected Map<String, PartitioningPolicy>
partitioningPolicies

Map of named partitioning policies, keyed by their name.

protected List<DatabaseQuery>
queries

List of queries - once Project is initialized, these are copied to the Session.

protected boolean
queryCacheForceDeferredLocks

Force all queries and relationships to use deferred lock strategy during object building and L2 cache population.

protected Map<String, SQLResultSetMapping>
sqlResultSetMappings

This a collection of 'maps' that allow users to map custom SQL to query results

protected Collection<String>
protected String
vpdIdentifier

VPD connection settings

protected String

Constructor Summary

AccessConstructor and Description
public
Project()

PUBLIC: Create a new project.

public
Project(Login login)

PUBLIC: Create a new project that will connect through the login information.

public
Project(DatabaseLogin login)

PUBLIC: Create a new project that will connect through JDBC using the login information.

Method Summary

Modifier and TypeMethod and Description
public void
addAlias(String alias, ClassDescriptor descriptor)

PUBLIC: Add an alias for the descriptor.

public void
addDefaultReadOnlyClass(Class<?> readOnlyClass)

PUBLIC: Add the read-only class which apply to each UnitOfWork created by default.

public void
addDescriptor(ClassDescriptor descriptor)

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.addDescriptor.

PUBLIC: Add the descriptor to the project.
public void
addDescriptor(final ClassDescriptor
The descriptor to be added to the session and the project.
descriptor
,
final DatabaseSessionImpl
The current database session.
session
)

INTERNAL: Used by the BuilderInterface when reading a Project from INI files.

public void
addDescriptors(final Collection<E>
The descriptors to be added to the session and the project.
descriptors
,
final DatabaseSessionImpl
The current database session.
session
)

INTERNAL: Add the descriptors to the session.

public void
addDescriptors(Project project, DatabaseSessionImpl session)

PUBLIC: Merge the descriptors from another project into this one.

public void
addJPAQuery(DatabaseQuery query)

INTERNAL: Return all pre-defined not yet parsed EJBQL queries.

public void
addJPATablePerTenantQuery(DatabaseQuery query)

INTERNAL: Return all pre-defined not yet parsed EJBQL queries to table per tenant entities.

public void
addMappedSuperclass(String
(Metadata class)
key
,
ClassDescriptor
(RelationalDescriptor)
value
,
boolean replace)

INTERNAL: 266912: Add a descriptor to the Map of mappedSuperclass descriptors

public void
addMetamodelIdClassMapEntry(String ownerName, String name)

INTERNAL: Add an IdClass entry to the map of ids for a particular owner This function is used exclusively by the Metamodel API.

public void
addPartitioningPolicy(PartitioningPolicy partitioningPolicy)

PUBLIC: Set the map of partitioning policies, keyed by name.

public void
addSQLResultSetMapping(SQLResultSetMapping sqlResultSetMapping)

PUBLIC: Add a named SQLResultSetMapping to this project.

public boolean
allowExtendedCacheLogging()

INTERNAL: Return true if extended logging of JPA L2 cache usage is allowed on this project.

public boolean
allowExtendedThreadLogging()

INTERNAL: Return true if extended thread logging is allowed on this project.

public boolean
allowExtendedThreadLoggingThreadDump()

INTERNAL: Return true if thread dumps will be added to extended thread logging.

public boolean
allowNativeSQLQueries()

INTERNAL: Return true if native sql is allowed on this project.

public boolean
allowSQLDeferral()

INTERNAL: Return true if SQL calls can defer to EOT on this project.

public boolean
allowTablePerMultitenantDDLGeneration()

INTERNAL: Return true if native sql is allowed on this project.

public void
applyLogin()

INTERNAL: Default apply login implementation.

public void
assumeExistenceForDoesExist()

PUBLIC: Switch all descriptors to assume existence for non-null primary keys.

public void
checkCacheForDoesExist()

PUBLIC: Switch all descriptors to check the cache for existence.

public void
checkDatabaseForDoesExist()

PUBLIC: Switch all descriptors to check the database for existence.

public Project
clone()

Overrides java.lang.Object.clone.

INTERNAL: Clones the descriptor
public void
conformAllDescriptors()

PUBLIC: Set all this project's descriptors to conform all read queries within the context of the unit of work.

public void
convertClassNamesToClasses(ClassLoader classLoader)

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this project to actual class-based settings.
public DatabaseSession
createDatabaseSession()

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.createDatabaseSession.

PUBLIC: Factory method to create session.
public Server
createServerSession()

PUBLIC: Factory method to create a server session.

public Server
createServerSession(int min, int max)

PUBLIC: Factory method to create a server session.

public Server
createServerSession(int initial, int min, int max)

PUBLIC: Factory method to create a server session.

public Server
createServerSession(ConnectionPolicy defaultConnectionPolicy)

PUBLIC: Factory method to create a server session.

public Map<String, ClassDescriptor>
getAliasDescriptors()

INTERNAL: Returns the alias descriptors hashtable.

public Map<String, AttributeGroup>
getAttributeGroups()

INTERNAL: List of named AttributesGroups that will be copied to the session at initialization time.

public ClassDescriptor
getClassDescriptor(Class<?> theClass)

PUBLIC: Return the descriptor specified for the class.

public Collection<String>
getClassNamesForWeaving()

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

public Login
getDatasourceLogin()

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.getDatasourceLogin.

PUBLIC: Return the login, the login holds any database connection information given.
public CacheIsolationType
getDefaultCacheIsolation()

PUBLIC: Return the project level default for class cache isolation;

public Class<? extends IdentityMap>
getDefaultIdentityMapClass()

PUBLIC: Return default value for descriptor cache type.

public int
getDefaultIdentityMapSize()

PUBLIC: Return default value descriptor cache size.

public IdValidation
getDefaultIdValidation()

PUBLIC: Return default value for descriptor primary key validation.

public QueryResultsCachePolicy
getDefaultQueryResultsCachePolicy()

PUBLIC: Return the default values for query caching options for all named queries.

public Vector<E>
getDefaultReadOnlyClasses()

PUBLIC: Returns the default set of read-only classes.

public boolean
getDefaultTemporalMutable()

PUBLIC: Return the default setting for configuring if dates and calendars are mutable.

public ClassDescriptor
getDescriptor(Class<?> theClass)

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.getDescriptor.

PUBLIC: Return the descriptor specified for the class.
public ClassDescriptor
getDescriptorForAlias(String alias)

PUBLIC: Return the descriptor for the alias

public Map<Class<?>, ClassDescriptor>
getDescriptors()

PUBLIC: Return the descriptors in a ClassDescriptors Map keyed on the Java class.

public List<DatabaseQuery>
getJPAQueries()

INTERNAL: Return all pre-defined not yet parsed JPQL queries.

public List<DatabaseQuery>
getJPATablePerTenantQueries()

INTERNAL: Return all pre-defined not yet parsed JPQL queries to table per tenant entities.

public ConcurrentFixedCache
getJPQLParseCache()

INTERNAL: Return the JPQL parse cache.

public int
getJPQLParseCacheMaxSize()

ADVANCED: Return the JPQL parse cache max size.

public DatabaseLogin
getLogin()

OBSOLETE: Return the login, the login holds any database connection information given.

public ClassDescriptor
getMappedSuperclass(String
- theMetadata class
key
)

INTERNAL: Use the Metadata key parameter to lookup the Descriptor from the Map of mappedSuperclass descriptors

public Map<String, ClassDescriptor>
getMappedSuperclassDescriptors()

INTERNAL: Return the Map of RelationalDescriptor objects representing mapped superclass parents keyed by className of the metadata class.

public Map<String, List<String>>
getMetamodelIdClassMap()

INTERNAL: Return the Map of IdClass attribute lists keyed on owner class name.

public MultitenantPolicy
public String
getName()

PUBLIC: get the name of the project.

public List<ClassDescriptor>
getOrderedDescriptors()

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.getOrderedDescriptors.

INTERNAL: Return the descriptors in the order added.
public Map<String, PartitioningPolicy>
getPartitioningPolicies()

PUBLIC: Return the map of partitioning policies, keyed by name.

public PartitioningPolicy
getPartitioningPolicy(String name)

PUBLIC: Return the partitioning policies for the name.

public List<DatabaseQuery>
getQueries()

INTERNAL: List of queries that upon initialization are copied over to the session

public SQLResultSetMapping
getSQLResultSetMapping(String sqlResultSetMapping)

PUBLIC: Get a named SQLResultSetMapping from this project.

public Collection<String>
getStructConverters()

INTERNAL: Returns structure converter class names that would be set on the databasePlatform instance This is used to avoid the platform instance changing at login.

public String
getVPDIdentifier()

INTERNAL: Return the VPD identifier for this project.

public String
getVPDLastIdentifierClassName()

INTERNAL: Return the name of the last class to set a VPD identifiers.

public boolean
hasGenericHistorySupport()

INTERNAL: Answers if at least one Descriptor or Mapping had a HistoryPolicy at initialize time.

public boolean
hasIsolatedCacheClassWithoutUOWIsolation()

INTERNAL: Return whether this project has a descriptor that is both Isolated and has a cache isolation level other than ISOLATE_CACHE_ALWAYS

public boolean
hasIsolatedClasses()

INTERNAL: Return if any descriptors are isolated.

public boolean
hasMappedSuperclass(String className)

INTERNAL: Return whether the given class is mapped as superclass.

public boolean
hasMappedSuperclasses()

INTERNAL: Return whether there any mappings that are mapped superclasses.

public boolean
hasMappingsPostCalculateChangesOnDeleted()

INTERNAL: Indicates whether there is at least one descriptor that has at least on mapping that require a call on deleted objects to update change sets.

public boolean
hasNonIsolatedUOWClasses()

INTERNAL: Return if any descriptors are not isolated to the unit of work.

public boolean
hasProxyIndirection()

INTERNAL: Return if any descriptors use ProxyIndirection.

public boolean
hasSQLResultSetMapping(String sqlResultSetMapping)

PUBLIC: Return true if the sql result set mapping name exists.

public boolean
hasVPDIdentifier(AbstractSession session)

PUBLIC: Return true if there is a VPD identifier for this project.

public boolean
isAllowQueryResultsCacheValidation()

INTERNAL: Flag that allows query result cache validation or not.

public boolean
isQueryCacheForceDeferredLocks()

PUBLIC: Get property to Force all queries and relationships to use deferred lock strategy during object building and L2 cache population.

public boolean
namingIntoIndexed()

INTERNAL: Return true is allowed to transform named stored procedure parameters into positional/index based.

public void
setAliasDescriptors(Map<String, ClassDescriptor> aHashtable)

INTERNAL: Set the alias descriptors hashtable.

public void
setAllowExtendedCacheLogging(boolean allowExtendedCacheLogging)

INTERNAL: Set whether extended logging of JPA L2 cache usage is allowed on this project.

public void
setAllowExtendedThreadLogging(boolean allowExtendedThreadLogging)

INTERNAL: Set whether extended thread logging is allowed on this project.

public void
setAllowExtendedThreadLoggingThreadDump(boolean allowExtendedThreadLoggingThreadDump)

INTERNAL: Set if thread dumps will be added to extended thread logging.

public void
setAllowNativeSQLQueries(boolean allowNativeSQLQueries)

INTERNAL: Set whether native sql is allowed on this project.

public void
setAllowQueryResultsCacheValidation(boolean allowQueryResultsCacheValidation)

INTERNAL: Set to true to enable query result cache validation or not.

public void
setAllowSQLDeferral(boolean allowSQLDeferral)

INTERNAL: Set whether sql deferral is allowed on this project

public void
setAllowTablePerMultitenantDDLGeneration(boolean allowTablePerMultitenantDDLGeneration)

INTERNAL: Set whether ddl generation should allowed for table per tenant multitenant descriptors.

public void
setClassNamesForWeaving(Collection<String> classNamesForWeaving)

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

public void
setDatasourceLogin(Login datasourceLogin)

PUBLIC: Set the login to be used to connect to the database for this project.

public void
setDefaultCacheIsolation(CacheIsolationType isolationType)

PUBLIC: Set project level default value for class cache isolation.

public void
setDefaultIdentityMapClass(Class<? extends IdentityMap> defaultIdentityMapClass)

PUBLIC: Set default value for descriptor cache type.

public void
setDefaultIdentityMapSize(int defaultIdentityMapSize)

PUBLIC: Set default value descriptor cache size.

public void
setDefaultIdValidation(IdValidation defaultIdValidation)

PUBLIC: Set default value for descriptor primary key validation.

public void
setDefaultQueryResultsCachePolicy(QueryResultsCachePolicy defaultQueryResultsCachePolicy)

PUBLIC: Set the default values for query caching options for all named queries.

public void
setDefaultReadOnlyClasses(Collection<E> newValue)

PUBLIC: Set the read-only classes which apply to each UnitOfWork create by default.

public void
setDefaultTemporalMutable(boolean defaultTemporalMutable)

PUBLIC: Set the default setting for configuring if dates and calendars are mutable.

public void
setDeferModificationsUntilCommit(int deferralLevel)

ADVANCED: This method is a 'helper' method for updating all of the descriptors within this project to have a particular deferral level.

public void
setDescriptors(Map<K, V> descriptors)

INTERNAL: Set the descriptors registered with this session.

public void
setHasGenericHistorySupport(boolean hasGenericHistorySupport)

INTERNAL: Set to true during descriptor initialize if any descriptor has history.

public void
setHasIsolatedClasses(boolean hasIsolatedClasses)

INTERNAL: Set to true during descriptor initialize if any descriptor is isolated.

public void
setHasMappingsPostCalculateChangesOnDeleted(boolean hasMappingsPostCalculateChangesOnDeleted)

INTERNAL: Indicates whether there is at least one descriptor that has at least on mapping that require a call on deleted objects to update change sets.

public void
setHasNonIsolatedUOWClasses(boolean hasNonIsolatedUOWClasses)

INTERNAL: Set if any descriptors are not isolated to the unit of work.

public void
setHasProxyIndirection(boolean hasProxyIndirection)

INTERNAL: Set to true during descriptor initialize if any descriptor uses ProxyIndirection Determines if ProxyIndirectionPolicy.getValueFromProxy should be called.

protected void
setJPQLParseCache(ConcurrentFixedCache jpqlParseCache)

INTERNAL: Set the JPQL parse cache.

public void
setJPQLParseCacheMaxSize(int maxSize)

ADVANCED: Set the JPQL parse cache max size.

public void
setLogin(DatabaseLogin datasourceLogin)

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.setLogin.

PUBLIC: Set the login to be used to connect to the database for this project.
public void
setLogin(Login datasourceLogin)

Implements abstract org.eclipse.persistence.core.sessions.CoreProject.setLogin.

PUBLIC: Set the login to be used to connect to the database for this project.
public void
setMultitenantPolicy(MultitenantPolicy policy)

INTERNAL: Set the multitenant policy.

public void
setName(String name)

PUBLIC: Set the name of the project.

public void
setNamingIntoIndexed(boolean namingIntoIndexed)

INTERNAL: Set whether named stored procedure parameters is allowed to transform into positional/index based.

public void
setOrderedDescriptors(List<ClassDescriptor> orderedDescriptors)

INTERNAL: Set the descriptors order.

public void
setPartitioningPolicies(Map<String, PartitioningPolicy> partitioningPolicies)

PUBLIC: Set the map of partitioning policies, keyed by name.

public void
setQueries(List<DatabaseQuery> queries)

INTERNAL:

public void
setQueryCacheForceDeferredLocks(boolean queryCacheForceDeferredLocks)

PUBLIC: Set property to Force all queries and relationships to use deferred lock strategy during object building and L2 cache population.

public void
setStructConverters(Collection<String> structConverters)

INTERNAL: Returns structure converter class names that would be set on the databasePlatform instance This is used to avoid the platform instance changing at login.

public void
setVPDIdentifier(String vpdIdentifier)

INTERNAL: Set the VPD identifier for this project.

public void
setVPDLastIdentifierClassName(String vpdLastIdentifierClassName)

INTERNAL: Set from individual descriptors from the project that set a VPD identifier and used in validation exception.

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
public void
useCacheIdentityMap()

PUBLIC: Switch all descriptors to use the cache identity map.

public void
useCacheIdentityMap(int cacheSize)

PUBLIC: Switch all descriptors to use the cache identity map the size.

public void
useFullIdentityMap()

PUBLIC: Switch all descriptors to use the full identity map.

public void
useFullIdentityMap(int initialCacheSize)

PUBLIC: Switch all descriptors to use the full identity map with initial cache size.

public void
useNoIdentityMap()

PUBLIC: Switch all descriptors to use no identity map.

public void
useSoftCacheWeakIdentityMap()

PUBLIC: Switch all descriptors to use the soft cache weak identity map.

public void
useSoftCacheWeakIdentityMap(int cacheSize)

PUBLIC: Switch all descriptors to use the soft cache weak identity map with soft cache size.

public boolean
usesOptimisticLocking()

INTERNAL: Asks each descriptor if is uses optimistic locking.

public boolean
usesSequencing()

INTERNAL: Asks each descriptor if is uses sequencing.

public void
useWeakIdentityMap()

PUBLIC: Switch all descriptors to use the weak identity map.

public void
useWeakIdentityMap(int initialCacheSize)

PUBLIC: Switch all descriptors to use the weak identity map.