org.eclipse.persistence.sessions
public class Project extends Object implements Serializable, Cloneable
Responsibilities:
DatabaseLogin
,
Serialized FormConstructor and Description |
---|
Project()
PUBLIC:
Create a new project.
|
Project(DatabaseLogin login)
PUBLIC:
Create a new project that will connect through JDBC using the login information.
|
Project(Login login)
PUBLIC:
Create a new project that will connect through the login information.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlias(String alias,
ClassDescriptor descriptor)
PUBLIC:
Add an alias for the descriptor.
|
void |
addDefaultReadOnlyClass(Class readOnlyClass)
PUBLIC:
Add the read-only class which apply to each UnitOfWork created by default.
|
void |
addDescriptor(ClassDescriptor descriptor)
PUBLIC:
Add the descriptor to the project.
|
void |
addDescriptor(ClassDescriptor descriptor,
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
INTERNAL: Used by the BuilderInterface when reading a Project from INI files.
|
void |
addDescriptors(Collection descriptors,
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
INTERNAL:
Add the descriptors to the session.
|
void |
addDescriptors(Project project,
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
PUBLIC:
Merge the descriptors from another project into this one.
|
void |
addMappedSuperclass(Object key,
RelationalDescriptor value)
INTERNAL:
266912: Add a descriptor to the Map of mappedSuperclass descriptors
|
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.
|
void |
addSQLResultSetMapping(SQLResultSetMapping sqlResultSetMapping)
PUBLIC:
Add a named SQLResultSetMapping to this project.
|
void |
applyLogin()
INTERNAL:
Default apply login implementation.
|
void |
assumeExistenceForDoesExist()
PUBLIC:
Switch all descriptors to assume existence for non-null primary keys.
|
void |
checkCacheForDoesExist()
PUBLIC:
Switch all descriptors to check the cache for existence.
|
void |
checkDatabaseForDoesExist()
PUBLIC:
Switch all descriptors to check the database for existence.
|
Object |
clone()
INTERNAL:
Clones the descriptor
|
void |
conformAllDescriptors()
PUBLIC:
Set all this project's descriptors to conform all read queries within the context of the unit of work.
|
void |
convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL:
Convert all the class-name-based settings in this project to actual class-based settings.
|
DatabaseSession |
createDatabaseSession()
PUBLIC:
Factory method to create session.
|
Server |
createServerSession()
PUBLIC:
Factory method to create a server session.
|
Server |
createServerSession(ConnectionPolicy defaultConnectionPolicy)
PUBLIC:
Factory method to create a server session.
|
Server |
createServerSession(int min,
int max)
PUBLIC:
Factory method to create a server session.
|
Server |
createServerSession(int initial,
int min,
int max)
PUBLIC:
Factory method to create a server session.
|
Map |
getAliasDescriptors()
INTERNAL:
Returns the alias descriptors hashtable.
|
ClassDescriptor |
getClassDescriptor(Class theClass)
PUBLIC:
Return the descriptor specified for the class.
|
Login |
getDatasourceLogin()
PUBLIC:
Return the login, the login holds any database connection information given.
|
Class |
getDefaultIdentityMapClass()
PUBLIC:
Return default value for descriptor cache type.
|
int |
getDefaultIdentityMapSize()
PUBLIC:
Return default value descriptor cache size.
|
IdValidation |
getDefaultIdValidation()
PUBLIC:
Return default value for descriptor primary key validation.
|
boolean |
getDefaultIsIsolated()
PUBLIC:
Return default value for whether descriptor should use isolated cache.
|
Vector |
getDefaultReadOnlyClasses()
PUBLIC:
Returns the default set of read-only classes.
|
boolean |
getDefaultTemporalMutable()
PUBLIC:
Return the default setting for configuring if dates and calendars are mutable.
|
ClassDescriptor |
getDescriptor(Class theClass)
PUBLIC:
Return the descriptor specified for the class.
|
ClassDescriptor |
getDescriptorForAlias(String alias)
PUBLIC:
Return the descriptor for the alias
|
Map<Class,ClassDescriptor> |
getDescriptors()
PUBLIC:
Return the descriptors in a ClassDescriptors Map keyed on the Java class.
|
org.eclipse.persistence.internal.helper.ConcurrentFixedCache |
getJPQLParseCache()
INTERNAL:
Return the JPQL parse cache.
|
int |
getJPQLParseCacheMaxSize()
ADVANCED:
Return the JPQL parse cache max size.
|
DatabaseLogin |
getLogin()
OBSOLETE:
Return the login, the login holds any database connection information given.
|
RelationalDescriptor |
getMappedSuperclass(Object key)
INTERNAL:
Use the Metadata key parameter to lookup the
Descriptor from the Map of mappedSuperclass descriptors
|
Map<Object,RelationalDescriptor> |
getMappedSuperclassDescriptors()
INTERNAL:
Return the Map of RelationalDescriptor objects representing mapped superclass parents
keyed by className of the metadata class.
|
Map<String,List<String>> |
getMetamodelIdClassMap()
INTERNAL:
Return the Map of IdClass attribute lists keyed on owner class name.
|
String |
getName()
PUBLIC:
get the name of the project.
|
Vector |
getOrderedDescriptors()
INTERNAL:
Return the descriptors in the order added.
|
List<DatabaseQuery> |
getQueries()
INTERNAL:
List of queries that upon initialization are copied over to the session
|
SQLResultSetMapping |
getSQLResultSetMapping(String sqlResultSetMapping)
PUBLIC:
Get a named SQLResultSetMapping from this project.
|
boolean |
hasGenericHistorySupport()
INTERNAL:
Answers if at least one Descriptor or Mapping had a HistoryPolicy at initialize time.
|
boolean |
hasIsolatedClasses()
INTERNAL:
Return if any descriptors are isolated.
|
boolean |
hasMappedSuperclasses()
INTERNAL:
Return whether there any mappings that are mapped superclasses.
|
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.
|
boolean |
hasNonIsolatedUOWClasses()
INTERNAL:
Return if any descriptors are not isolated to the unit of work.
|
boolean |
hasProxyIndirection()
INTERNAL:
Return if any descriptors use ProxyIndirection.
|
boolean |
hasSQLResultSetMapping(String sqlResultSetMapping)
PUBLIC:
Return true if the sql result set mapping name exists.
|
void |
setAliasDescriptors(Map aHashtable)
INTERNAL:
Set the alias descriptors hashtable.
|
void |
setDatasourceLogin(Login datasourceLogin)
PUBLIC:
Set the login to be used to connect to the database for this project.
|
void |
setDefaultIdentityMapClass(Class defaultIdentityMapClass)
PUBLIC:
Set default value for descriptor cache type.
|
void |
setDefaultIdentityMapSize(int defaultIdentityMapSize)
PUBLIC:
Set default value descriptor cache size.
|
void |
setDefaultIdValidation(IdValidation defaultIdValidation)
PUBLIC:
Set default value for descriptor primary key validation.
|
void |
setDefaultIsIsolated(boolean defaultIsIsolated)
PUBLIC:
Set default value for whether descriptor should use isolated cache.
|
void |
setDefaultReadOnlyClasses(Collection newValue)
PUBLIC:
Set the read-only classes which apply to each UnitOfWork create by default.
|
void |
setDefaultTemporalMutable(boolean defaultTemporalMutable)
PUBLIC:
Set the default setting for configuring if dates and calendars are mutable.
|
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.
|
void |
setDescriptors(Map descriptors)
INTERNAL:
Set the descriptors registered with this session.
|
void |
setHasGenericHistorySupport(boolean hasGenericHistorySupport)
INTERNAL:
Set to true during descriptor initialize if any descriptor has history.
|
void |
setHasIsolatedClasses(boolean hasIsolatedClasses)
INTERNAL:
Set to true during descriptor initialize if any descriptor is isolated.
|
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.
|
void |
setHasNonIsolatedUOWClasses(boolean hasNonIsolatedUOWClasses)
INTERNAL:
Set if any descriptors are not isolated to the unit of work.
|
void |
setHasProxyIndirection(boolean hasProxyIndirection)
INTERNAL:
Set to true during descriptor initialize if any descriptor uses ProxyIndirection
Determines if ProxyIndirectionPolicy.getValueFromProxy should be called.
|
void |
setJPQLParseCacheMaxSize(int maxSize)
ADVANCED:
Set the JPQL parse cache max size.
|
void |
setLogin(DatabaseLogin datasourceLogin)
PUBLIC:
Set the login to be used to connect to the database for this project.
|
void |
setLogin(Login datasourceLogin)
PUBLIC:
Set the login to be used to connect to the database for this project.
|
void |
setName(String name)
PUBLIC:
Set the name of the project.
|
void |
setOrderedDescriptors(Vector orderedDescriptors)
INTERNAL:
Set the descriptors order.
|
void |
setQueries(List<DatabaseQuery> queries)
INTERNAL:
|
String |
toString()
INTERNAL:
|
void |
useCacheIdentityMap()
PUBLIC:
Switch all descriptors to use the cache identity map.
|
void |
useCacheIdentityMap(int cacheSize)
PUBLIC:
Switch all descriptors to use the cache identity map the size.
|
void |
useFullIdentityMap()
PUBLIC:
Switch all descriptors to use the full identity map.
|
void |
useFullIdentityMap(int initialCacheSize)
PUBLIC:
Switch all descriptors to use the full identity map with initial cache size.
|
void |
useNoIdentityMap()
PUBLIC:
Switch all descriptors to use no identity map.
|
void |
useSoftCacheWeakIdentityMap()
PUBLIC:
Switch all descriptors to use the soft cache weak identity map.
|
void |
useSoftCacheWeakIdentityMap(int cacheSize)
PUBLIC:
Switch all descriptors to use the soft cache weak identity map with soft cache size.
|
boolean |
usesOptimisticLocking()
INTERNAL:
Asks each descriptor if is uses optimistic locking.
|
boolean |
usesSequencing()
INTERNAL:
Asks each descriptor if is uses sequencing.
|
void |
useWeakIdentityMap()
PUBLIC:
Switch all descriptors to use the weak identity map.
|
void |
useWeakIdentityMap(int initialCacheSize)
PUBLIC:
Switch all descriptors to use the weak identity map.
|
public Project()
public Project(Login login)
public Project(DatabaseLogin login)
public boolean getDefaultTemporalMutable()
public void setDefaultTemporalMutable(boolean defaultTemporalMutable)
public org.eclipse.persistence.internal.helper.ConcurrentFixedCache getJPQLParseCache()
public void setJPQLParseCacheMaxSize(int maxSize)
public int getJPQLParseCacheMaxSize()
public List<DatabaseQuery> getQueries()
public void setQueries(List<DatabaseQuery> queries)
queries
- public void addDefaultReadOnlyClass(Class readOnlyClass)
public void addDescriptor(ClassDescriptor descriptor)
public void addDescriptor(ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
public void addDescriptors(Collection descriptors, org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
public void addDescriptors(Project project, org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session)
public void addSQLResultSetMapping(SQLResultSetMapping sqlResultSetMapping)
public void conformAllDescriptors()
public void convertClassNamesToClasses(ClassLoader classLoader)
public void assumeExistenceForDoesExist()
public void checkCacheForDoesExist()
public void checkDatabaseForDoesExist()
public DatabaseSession createDatabaseSession()
public Server createServerSession()
public Server createServerSession(int min, int max)
public Server createServerSession(int initial, int min, int max)
public Server createServerSession(ConnectionPolicy defaultConnectionPolicy)
public Vector getDefaultReadOnlyClasses()
public Class getDefaultIdentityMapClass()
public int getDefaultIdentityMapSize()
public boolean getDefaultIsIsolated()
public IdValidation getDefaultIdValidation()
public ClassDescriptor getClassDescriptor(Class theClass)
public ClassDescriptor getDescriptor(Class theClass)
public Map<Class,ClassDescriptor> getDescriptors()
public Vector getOrderedDescriptors()
public void setOrderedDescriptors(Vector orderedDescriptors)
public DatabaseLogin getLogin()
public Login getDatasourceLogin()
public String getName()
public SQLResultSetMapping getSQLResultSetMapping(String sqlResultSetMapping)
public boolean hasGenericHistorySupport()
public void setDefaultReadOnlyClasses(Collection newValue)
public void setDefaultIdentityMapClass(Class defaultIdentityMapClass)
public void setDefaultIdentityMapSize(int defaultIdentityMapSize)
public void setDefaultIsIsolated(boolean defaultIsIsolated)
public void setDefaultIdValidation(IdValidation defaultIdValidation)
public void setDescriptors(Map descriptors)
public void setDeferModificationsUntilCommit(int deferralLevel)
public void setHasGenericHistorySupport(boolean hasGenericHistorySupport)
public boolean hasIsolatedClasses()
public void setHasIsolatedClasses(boolean hasIsolatedClasses)
public boolean hasNonIsolatedUOWClasses()
public void setHasNonIsolatedUOWClasses(boolean hasNonIsolatedUOWClasses)
public boolean hasProxyIndirection()
public boolean hasSQLResultSetMapping(String sqlResultSetMapping)
public void setHasProxyIndirection(boolean hasProxyIndirection)
public void setLogin(DatabaseLogin datasourceLogin)
public void setLogin(Login datasourceLogin)
public void setDatasourceLogin(Login datasourceLogin)
public void setName(String name)
public void useCacheIdentityMap()
public void useCacheIdentityMap(int cacheSize)
public void useFullIdentityMap()
public void useFullIdentityMap(int initialCacheSize)
public void useNoIdentityMap()
public void useSoftCacheWeakIdentityMap()
public void useSoftCacheWeakIdentityMap(int cacheSize)
public boolean usesOptimisticLocking()
public boolean usesSequencing()
public void useWeakIdentityMap()
public void useWeakIdentityMap(int initialCacheSize)
public void applyLogin()
public Map getAliasDescriptors()
public void addAlias(String alias, ClassDescriptor descriptor)
public ClassDescriptor getDescriptorForAlias(String alias)
public void setAliasDescriptors(Map aHashtable)
public boolean hasMappingsPostCalculateChangesOnDeleted()
public void setHasMappingsPostCalculateChangesOnDeleted(boolean hasMappingsPostCalculateChangesOnDeleted)
public boolean hasMappedSuperclasses()
public void addMappedSuperclass(Object key, RelationalDescriptor value)
key
- (Metadata class)value
- (RelationalDescriptor)public RelationalDescriptor getMappedSuperclass(Object key)
key
- - theMetadata classpublic Map<Object,RelationalDescriptor> getMappedSuperclassDescriptors()
public void addMetamodelIdClassMapEntry(String ownerName, String name)
idMap
- ownerName
- name
-