Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

B32476-03

oracle.toplink.sessions
Class Project

java.lang.Object
  extended by oracle.toplink.sessions.Project
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Project
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

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

Responsibilities:

See Also:
DatabaseLogin, Serialized Form

Constructor Summary
Project()
          Create a new project.
Project(DatabaseLogin login)
          Create a new project that will connect through JDBC using the login information.
Project(Login login)
          Create a new project that will connect through the login information.
 
Method Summary
 void addAlias(java.lang.String alias, ClassDescriptor descriptor)
          Add an alias for the descriptor.
 void addDefaultReadOnlyClass(java.lang.Class readOnlyClass)
          Add the read-only class which apply to each UnitOfWork created by default.
 void addDescriptor(ClassDescriptor descriptor)
          Add the descriptor to the project.
 void addDescriptors(Project project, oracle.toplink.internal.sessions.DatabaseSessionImpl session)
          Merge the descriptors from another project into this one.
 void addSQLResultSetMapping(SQLResultSetMapping sqlResultSetMapping)
          Add a named SQLResultSetMapping to this project.
 void assumeExistenceForDoesExist()
          Switch all descriptors to assume existence for non-null primary keys.
 void checkCacheForDoesExist()
          Switch all descriptors to check the cache for existence.
 void checkDatabaseForDoesExist()
          Switch all descriptors to check the database for existence.
 void conformAllDescriptors()
          Set all this project's descriptors to conform all read queries within the context of the unit of work.
 DatabaseSession createDatabaseSession()
          Factory method to create session.
 Server createServerSession()
          Factory method to create a server session.
 Server createServerSession(ConnectionPolicy defaultConnectionPolicy)
          Factory method to create a server session.
 Server createServerSession(int min, int max)
          Factory method to create a server session.
 ClassDescriptor getClassDescriptor(java.lang.Class theClass)
          Return the descriptor specified for the class.
 Login getDatasourceLogin()
          Return the login, the login holds any database connection information given.
 java.util.Vector getDefaultReadOnlyClasses()
          Returns the default set of read-only classes.
 boolean getDefaultTemporalMutable()
          Return the default setting for configuring if dates and calendars are mutable.
 ClassDescriptor getDescriptor(java.lang.Class theClass)
          Return the descriptor specified for the class.
 ClassDescriptor getDescriptorForAlias(java.lang.String alias)
          Return the descriptor for the alias
 java.util.Map getDescriptors()
          Return the descriptors.
 int getJPQLParseCacheMaxSize()
          ADVANCED: Return the JPQL parse cache max size.
 DatabaseLogin getLogin()
          OBSOLETE: Return the login, the login holds any database connection information given.
 java.lang.String getName()
          get the name of the project.
 SQLResultSetMapping getSQLResultSetMapping(java.lang.String sqlResultSetMapping)
          Get a named SQLResultSetMapping from this project.
 void setDatasourceLogin(Login datasourceLogin)
          Set the login to be used to connect to the database for this project.
 void setDefaultReadOnlyClasses(java.util.Vector newValue)
          Set the read-only classes which apply to each UnitOfWork create by default.
 void setDefaultTemporalMutable(boolean defaultTemporalMutable)
          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 setJPQLParseCacheMaxSize(int maxSize)
          ADVANCED: Set the JPQL parse cache max size.
 void setLogin(DatabaseLogin datasourceLogin)
          Set the login to be used to connect to the database for this project.
 void setLogin(Login datasourceLogin)
          Set the login to be used to connect to the database for this project.
 void setName(java.lang.String name)
          Set the name of the project.
 void useCacheIdentityMap()
          Switch all descriptors to use the cache identity map.
 void useCacheIdentityMap(int cacheSize)
          Switch all descriptors to use the cache identity map the size.
 void useFullIdentityMap()
          Switch all descriptors to use the full identity map.
 void useFullIdentityMap(int initialCacheSize)
          Switch all descriptors to use the full identity map with initial cache size.
 void useNoIdentityMap()
          Switch all descriptors to use no identity map.
 void useSoftCacheWeakIdentityMap()
          Switch all descriptors to use the soft cache weak identity map.
 void useSoftCacheWeakIdentityMap(int cacheSize)
          Switch all descriptors to use the soft cache weak identity map with soft cache size.
 void useWeakIdentityMap()
          Switch all descriptors to use the weak identity map.
 void useWeakIdentityMap(int initialCacheSize)
          Switch all descriptors to use the weak identity map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Project

public Project()
Create a new project.


Project

public Project(Login login)
Create a new project that will connect through the login information. This method can be used if the project is being create in code instead of being read from a file.


Project

public Project(DatabaseLogin login)
Create a new project that will connect through JDBC using the login information. This method can be used if the project is being create in code instead of being read from a file.

Method Detail

getDefaultTemporalMutable

public boolean getDefaultTemporalMutable()
Return the default setting for configuring if dates and calendars are mutable. Mutable means that changes to the date's year/month/day are detected. By default they are treated as not mutable.


setDefaultTemporalMutable

public void setDefaultTemporalMutable(boolean defaultTemporalMutable)
Set the default setting for configuring if dates and calendars are mutable. Mutable means that changes to the date's year/month/day are detected. By default they are treated as not mutable.


setJPQLParseCacheMaxSize

public void setJPQLParseCacheMaxSize(int maxSize)
ADVANCED: Set the JPQL parse cache max size. This is used to optimize dynamic JPQL.


getJPQLParseCacheMaxSize

public int getJPQLParseCacheMaxSize()
ADVANCED: Return the JPQL parse cache max size. This is used to optimize dynamic JPQL.


addDefaultReadOnlyClass

public void addDefaultReadOnlyClass(java.lang.Class readOnlyClass)
Add the read-only class which apply to each UnitOfWork created by default.


addDescriptor

public void addDescriptor(ClassDescriptor descriptor)
Add the descriptor to the project.


addDescriptors

public void addDescriptors(Project project,
                           oracle.toplink.internal.sessions.DatabaseSessionImpl session)
Merge the descriptors from another project into this one. All persistent classes must have a descriptor registered for them with the session. This method allows for a batch of descriptors to be added at once so that TopLink can resolve the dependancies between the descriptors and perform initialization optimially.


addSQLResultSetMapping

public void addSQLResultSetMapping(SQLResultSetMapping sqlResultSetMapping)
Add a named SQLResultSetMapping to this project. These SQLResultSetMappings can be later used by ResultSetMappingQueries to map Custom sql results to results as defined by the SQLResultSetMappings.


conformAllDescriptors

public void conformAllDescriptors()
Set all this project's descriptors to conform all read queries within the context of the unit of work.


assumeExistenceForDoesExist

public void assumeExistenceForDoesExist()
Switch all descriptors to assume existence for non-null primary keys.


checkCacheForDoesExist

public void checkCacheForDoesExist()
Switch all descriptors to check the cache for existence.


checkDatabaseForDoesExist

public void checkDatabaseForDoesExist()
Switch all descriptors to check the database for existence.


createDatabaseSession

public DatabaseSession createDatabaseSession()
Factory method to create session. This returns an implementor of the DatabaseSession interface, which can be used to login and add descriptors from other projects. The Session interface however should be used for reading and writing once connected for complete portability.


createServerSession

public Server createServerSession()
Factory method to create a server session. This returns an implementor of the Server interface, which can be used to login and add descriptors from other projects, configure connection pooling and acquire client sessions.


createServerSession

public Server createServerSession(int min,
                                  int max)
Factory method to create a server session. This returns an implementor of the Server interface, which can be used to login and add descriptors from other projects, configure connection pooling and acquire client sessions. Configure the min and max number of connections for the default pool.


createServerSession

public Server createServerSession(ConnectionPolicy defaultConnectionPolicy)
Factory method to create a server session. This returns an implementor of the Server interface, which can be used to login and add descriptors from other projects, configure connection pooling and acquire client sessions. Configure the default connection policy to be used. This policy is used on the "acquireClientSession()" protocol.


getDefaultReadOnlyClasses

public java.util.Vector getDefaultReadOnlyClasses()
Returns the default set of read-only classes.


getClassDescriptor

public ClassDescriptor getClassDescriptor(java.lang.Class theClass)
Return the descriptor specified for the class. If the passed Class parameter is null, null will be returned.


getDescriptor

public ClassDescriptor getDescriptor(java.lang.Class theClass)
Return the descriptor specified for the class.


getDescriptors

public java.util.Map getDescriptors()
Return the descriptors.


getLogin

public DatabaseLogin getLogin()
OBSOLETE: Return the login, the login holds any database connection information given. This has been replaced by getDatasourceLogin to make use of the Login interface to support non-relational datasources, if DatabaseLogin API is required it will need to be cast.


getDatasourceLogin

public Login getDatasourceLogin()
Return the login, the login holds any database connection information given. This return the Login interface and may need to be cast to the datasource specific implementation.


getName

public java.lang.String getName()
get the name of the project.


getSQLResultSetMapping

public SQLResultSetMapping getSQLResultSetMapping(java.lang.String sqlResultSetMapping)
Get a named SQLResultSetMapping from this project. These SQLResultSetMappings can be used by ResultSetMappingQueries to map Custom sql results to results as defined by the SQLResultSetMappings.


setDefaultReadOnlyClasses

public void setDefaultReadOnlyClasses(java.util.Vector newValue)
Set the read-only classes which apply to each UnitOfWork create by default.


setDeferModificationsUntilCommit

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. The levels are as follows ClassDescriptor.ALL_MODIFICATIONS - this is the default and recommended. The writing of all changes will be deferred until the end of the transaction ClassDescriptor.UPDATE_MODIFICATIONS - this will cause the update changes to be deferred and all other changes to be written immediately. ClassDescriptor.NONE - this will cause all changes to be written on each container call.


setLogin

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


setLogin

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


setDatasourceLogin

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


setName

public void setName(java.lang.String name)
Set the name of the project.


useCacheIdentityMap

public void useCacheIdentityMap()
Switch all descriptors to use the cache identity map.


useCacheIdentityMap

public void useCacheIdentityMap(int cacheSize)
Switch all descriptors to use the cache identity map the size.


useFullIdentityMap

public void useFullIdentityMap()
Switch all descriptors to use the full identity map.


useFullIdentityMap

public void useFullIdentityMap(int initialCacheSize)
Switch all descriptors to use the full identity map with initial cache size.


useNoIdentityMap

public void useNoIdentityMap()
Switch all descriptors to use no identity map.


useSoftCacheWeakIdentityMap

public void useSoftCacheWeakIdentityMap()
Switch all descriptors to use the soft cache weak identity map.


useSoftCacheWeakIdentityMap

public void useSoftCacheWeakIdentityMap(int cacheSize)
Switch all descriptors to use the soft cache weak identity map with soft cache size.


useWeakIdentityMap

public void useWeakIdentityMap()
Switch all descriptors to use the weak identity map.


useWeakIdentityMap

public void useWeakIdentityMap(int initialCacheSize)
Switch all descriptors to use the weak identity map.


addAlias

public void addAlias(java.lang.String alias,
                     ClassDescriptor descriptor)
Add an alias for the descriptor.


getDescriptorForAlias

public ClassDescriptor getDescriptorForAlias(java.lang.String alias)
Return the descriptor for the alias


Copyright © 1998, 2010, Oracle. All Rights Reserved.