Methods Summary |
---|
public oracle.toplink.essentials.sessions.UnitOfWork | acquireUnitOfWork()PUBLIC:
Return a unit of work for this session.
The unit of work is an object level transaction that allows
a group of changes to be applied as a unit.
The return value should be used as the oracle.toplink.essentials.sessions.UnitOfWork interface,
but must currently be returned as oracle.toplink.essentials.publicinterface.UnitOfWork to maintain backward
compatibility.
|
public void | addEjbqlPlaceHolderQuery(oracle.toplink.essentials.queryframework.DatabaseQuery query)ADVANCED:
Add a pre-defined not yet parsed EJBQL String/query to the session to be parsed
after descriptors are initialized.
|
public void | addQuery(java.lang.String name, oracle.toplink.essentials.queryframework.DatabaseQuery query)PUBLIC:
Add the query to the session queries with the given name.
This allows for common queries to be pre-defined, reused and executed by name.
|
public void | clearIntegrityChecker()PUBLIC:
clear the integrityChecker, the integrityChecker holds all the Descriptor Exceptions.
|
public void | clearProfile()PUBLIC:
Clear the profiler, this will end the current profile opperation.
|
public boolean | containsQuery(java.lang.String queryName)PUBLIC:
Return true if the pre-defined query is defined on the session.
|
public java.lang.Object | copyObject(java.lang.Object original)PUBLIC:
Return a complete copy of the object.
This can be used to obtain a scatch copy of an object,
or for templatizing an existing object into another new object.
The object and all of its privately owned parts will be copied, the object's primary key will be reset to null.
|
public java.lang.Object | copyObject(java.lang.Object original, oracle.toplink.essentials.sessions.ObjectCopyingPolicy policy)PUBLIC:
Return a complete copy of the object.
This can be used to obtain a scatch copy of an object,
or for templatizing an existing object into another new object.
The object copying policy allow for the depth, and reseting of the primary key to null, to be specified.
|
public boolean | doesObjectExist(java.lang.Object object)PUBLIC:
Return if the object exists on the database or not.
This always checks existence on the database.
|
public void | dontLogMessages()PUBLIC:
Turn off logging
|
public int | executeNonSelectingCall(oracle.toplink.essentials.queryframework.Call call)PUBLIC:
Execute the call on the database.
The row count is returned.
The call can be a stored procedure call, SQL call or other type of call.
Example:
session.executeNonSelectingCall(new SQLCall("Delete from Employee");
|
public void | executeNonSelectingSQL(java.lang.String sqlString)PUBLIC:
Execute the non-selecting (update/DML) SQL string.
|
public java.lang.Object | executeQuery(java.lang.String queryName)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Class domainClass)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
The class is the descriptor in which the query was pre-defined.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.lang.Object arg1)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
The class is the descriptor in which the query was pre-defined.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.lang.Object arg1, java.lang.Object arg2)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
The class is the descriptor in which the query was pre-defined.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
The class is the descriptor in which the query was pre-defined.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.Vector argumentValues)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
The class is the descriptor in which the query was pre-defined.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Object arg1)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Object arg1, java.lang.Object arg2)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
|
public java.lang.Object | executeQuery(java.lang.String queryName, java.util.Vector argumentValues)PUBLIC:
Execute the pre-defined query by name and return the result.
Queries can be pre-defined and named to allow for their reuse.
|
public java.lang.Object | executeQuery(oracle.toplink.essentials.queryframework.DatabaseQuery query)PUBLIC:
Execute the database query.
A query is a database operation such as reading or writting.
The query allows for the operation to be customized for such things as,
performance, depth, caching, etc.
|
public java.lang.Object | executeQuery(oracle.toplink.essentials.queryframework.DatabaseQuery query, java.util.Vector argumentValues)PUBLIC:
Return the results from exeucting the database query.
the arguments are passed in as a vector
|
public java.util.Vector | executeSQL(java.lang.String sqlString)PUBLIC:
Execute the selecting SQL string.
A Vector of DatabaseRecords are returned.
|
public java.util.Vector | executeSelectingCall(oracle.toplink.essentials.queryframework.Call call)PUBLIC:
Execute the call on the database and return the result.
The call must return a value, if no value is return executeNonSelectCall must be used.
The call can be a stored procedure call, SQL call or other type of call.
A vector of database rows is returned, database row implements Java 2 Map which should be used to access the data.
Example:
session.executeSelectingCall(new SQLCall("Select * from Employee");
|
public oracle.toplink.essentials.sessions.Session | getActiveSession()PUBLIC:
Return the active session for the current active external (JTS) transaction.
This should only be used with JTS and will return the session if no external transaction exists.
|
public oracle.toplink.essentials.sessions.UnitOfWork | getActiveUnitOfWork()PUBLIC:
Return the active unit of work for the current active external (JTS) transaction.
This should only be used with JTS and will return null if no external transaction exists.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptor(java.lang.Class theClass)ADVANCED:
Return the descriptor specified for the class.
If the class does not have a descriptor but implements an interface that is also implemented
by one of the classes stored in the hashtable, that descriptor will be stored under the
new class.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptor(java.lang.Object domainObject)ADVANCED:
Return the descriptor specified for the object's class.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptorForAlias(java.lang.String alias)PUBLIC:
Return the descriptor for the alias.
|
public oracle.toplink.essentials.sessions.Login | getDatasourceLogin()PUBLIC:
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.
|
public oracle.toplink.essentials.internal.databaseaccess.Platform | getDatasourcePlatform()PUBLIC:
Return the database platform currently connected to.
The platform is used for database specific behavoir.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getDescriptor(java.lang.Class theClass)ADVANCED:
Return the descriptor specified for the object's class.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getDescriptor(java.lang.Object domainObject)ADVANCED:
Return the descriptor specified for the object's class.
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getDescriptorForAlias(java.lang.String alias)PUBLIC:
Return the descriptor for the alias.
|
public java.util.Map | getDescriptors()ADVANCED:
Return all registered descriptors.
|
public java.util.List | getEjbqlPlaceHolderQueries()ADVANCED:
Return all pre-defined not yet parsed EJBQL queries.
|
public oracle.toplink.essentials.sessions.SessionEventManager | getEventManager()PUBLIC:
Return the event manager.
The event manager can be used to register for various session events.
|
public oracle.toplink.essentials.exceptions.ExceptionHandler | getExceptionHandler()PUBLIC:
Return the ExceptionHandler.Exception handler can catch errors that occur on queries or during database access.
|
public oracle.toplink.essentials.sessions.ExternalTransactionController | getExternalTransactionController()PUBLIC:
Used for JTS integration. If your application requires to have JTS control transactions instead of TopLink an
external transaction controler must be specified. TopLink provides JTS controlers for JTS 1.0 and Weblogic's JTS.
|
public oracle.toplink.essentials.sessions.IdentityMapAccessor | getIdentityMapAccessor()PUBLIC:
The IdentityMapAccessor is the preferred way of accessing IdentityMap funcitons
This will return an object which implements an interface which exposes all public
IdentityMap functions.
|
public oracle.toplink.essentials.exceptions.IntegrityChecker | getIntegrityChecker()PUBLIC:
Returns the integrityChecker,the integrityChecker holds all the Descriptor Exceptions.
|
public java.io.Writer | getLog()PUBLIC:
Return the writer to which an accessor writes logged messages and SQL.
If not set, this reference defaults to a writer on System.out.
|
public int | getLogLevel(java.lang.String category)PUBLIC:
Return the log level
|
public int | getLogLevel()PUBLIC:
Return the log level
|
public oracle.toplink.essentials.sessions.DatabaseLogin | getLogin()PUBLIC:
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.
|
public java.lang.String | getName()PUBLIC:
Return the name of the session.
This is used with the session broker, or to give the session a more meaningful name.
|
public java.lang.Number | getNextSequenceNumberValue(java.lang.Class domainClass)ADVANCED:
Return the sequnce number from the database
|
public oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform | getPlatform()PUBLIC:
Return the database platform currently connected to.
The platform is used for database specific behavoir.
NOTE: this must only be used for relational specific usage,
it will fail for non-relational datasources.
|
public oracle.toplink.essentials.sessions.SessionProfiler | getProfiler()PUBLIC:
Return the profiler.
The profiler is a tool that can be used to determine performance bottlenecks.
The profiler can be queries to print summaries and configure for logging purposes.
|
public oracle.toplink.essentials.sessions.Project | getProject()PUBLIC:
Return the project.
The project includes the login and descriptor and other configuration information.
|
public java.util.Map | getProperties()ADVANCED:
Allow for user defined properties.
|
public java.lang.Object | getProperty(java.lang.String name)ADVANCED:
Returns the user defined property.
|
public java.util.Map | getQueries()ADVANCED:
Return all pre-defined queries.
|
public oracle.toplink.essentials.queryframework.DatabaseQuery | getQuery(java.lang.String name)PUBLIC:
Return the query from the session pre-defined queries with the given name.
This allows for common queries to be pre-defined, reused and executed by name.
|
public oracle.toplink.essentials.queryframework.DatabaseQuery | getQuery(java.lang.String name, java.util.Vector arguments)PUBLIC:
Return the query from the session pre-defined queries with the given name.
This allows for common queries to be pre-defined, reused and executed by name.
|
public oracle.toplink.essentials.logging.SessionLog | getSessionLog()PUBLIC:
Return the session log to which an accessor logs messages and SQL.
If not set, this will default to a session log on a writer on System.out.
|
public java.lang.Object | handleException(java.lang.RuntimeException exception)PUBLIC:
Allow any WARNING level exceptions that occur within TopLink to be logged and handled by the exception handler.
|
public java.lang.Object | handleSevere(java.lang.RuntimeException exception)PUBLIC:
Allow any SEVERE level exceptions that occur within TopLink to be logged and handled by the exception handler.
|
public boolean | hasDescriptor(java.lang.Class theClass)ADVANCED:
Return true if a descriptor exists for the given class.
|
public boolean | hasExceptionHandler()PUBLIC:
Return if an exception handler is present.
|
public boolean | hasExternalTransactionController()PUBLIC:
Used for JTS integration. If your application requires to have JTS control transactions instead of TopLink an
external transaction controler must be specified. TopLink provides JTS controlers for JTS 1.0 and Weblogic's JTS.
|
public boolean | isClientSession()PUBLIC:
Return if this session is a client session.
|
public boolean | isConnected()PUBLIC:
Return if this session is connected to the database.
|
public boolean | isDatabaseSession()PUBLIC:
Return if this session is a database session.
|
public boolean | isDistributedSession()PUBLIC:
Return if this session is a distributed session.
|
public boolean | isInProfile()PUBLIC:
Return if a profiler is being used.
|
public boolean | isRemoteSession()PUBLIC:
Return if this session is a remote session.
|
public boolean | isRemoteUnitOfWork()PUBLIC:
Return if this session is a remote unit of work.
|
public boolean | isServerSession()PUBLIC:
Return if this session is a server session.
|
public boolean | isSessionBroker()PUBLIC:
Return if this session is a session broker.
|
public boolean | isUnitOfWork()PUBLIC:
Return if this session is a unit of work.
|
public java.util.Vector | keyFromObject(java.lang.Object domainObject)ADVANCED:
Extract and return the primary key from the object.
|
public void | log(oracle.toplink.essentials.logging.SessionLogEntry entry)PUBLIC:
Log the log entry.
|
public void | log(int level, java.lang.String category, java.lang.String message)PUBLIC:
Log a message with level and category.
|
public void | logMessage(java.lang.String message)Log a untranslated message to the TopLink log at FINER level.
|
public void | logThrowable(int level, java.lang.String category, java.lang.Throwable throwable)PUBLIC:
Log a throwable with level and category.
|
public java.util.Vector | readAllObjects(java.lang.Class domainClass)PUBLIC:
Read all of the instances of the class from the database.
This operation can be customized through using a ReadAllQuery,
or through also passing in a selection criteria.
|
public java.util.Vector | readAllObjects(java.lang.Class domainClass, oracle.toplink.essentials.queryframework.Call aCall)PUBLIC:
Read all the instances of the class from the database returned through execution the Call string.
The Call can be an SQLCall or EJBQLCall.
example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));
|
public java.util.Vector | readAllObjects(java.lang.Class domainClass, oracle.toplink.essentials.expressions.Expression selectionCriteria)PUBLIC:
Read all of the instances of the class from the database matching the given expression.
This operation can be customized through using a ReadAllQuery.
|
public java.lang.Object | readObject(java.lang.Class domainClass)PUBLIC:
Read the first instance of the class from the database.
This operation can be customized through using a ReadObjectQuery,
or through also passing in a selection criteria.
By default, this method executes a query without selection criteria and
consequently it will always result in a database access even if an instance
of the specified Class exists in the cache. Executing a query with
selection criteria allows you to avoid a database access if the selected
instance is in the cache.
Because of this, you may whish to consider a readObject method that takes selection criteria, such as: {@link #readObject(Class, Call)}, {@link #readObject(Class, Expression)}, or {@link #readObject(Object)}.
|
public java.lang.Object | readObject(java.lang.Class domainClass, oracle.toplink.essentials.queryframework.Call aCall)PUBLIC:
Read the first instance of the class from the database returned through execution the Call string.
The Call can be an SQLCall or EJBQLCall.
example: session.readObject(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));
|
public java.lang.Object | readObject(java.lang.Class domainClass, oracle.toplink.essentials.expressions.Expression selectionCriteria)PUBLIC:
Read the first instance of the class from the database matching the given expression.
This operation can be customized through using a ReadObjectQuery.
|
public java.lang.Object | readObject(java.lang.Object object)PUBLIC:
Use the example object to consruct a read object query by the objects primary key.
This will read the object from the database with the same primary key as the object
or null if no object is found.
|
public java.lang.Object | refreshObject(java.lang.Object object)PUBLIC:
Refresh the attributes of the object and of all of its private parts from the database.
This can be used to ensure the object is up to date with the database.
Caution should be used when using this to make sure the application has no un commited
changes to the object.
|
public void | release()PUBLIC:
Release the session.
This does nothing by default, but allows for other sessions such as the ClientSession to do something.
|
public void | removeProperty(java.lang.String property)PUBLIC:
Remove the user defined property.
|
public void | removeQuery(java.lang.String queryName)PUBLIC:
Remove the query name from the set of pre-defined queries
|
public void | setExceptionHandler(oracle.toplink.essentials.exceptions.ExceptionHandler exceptionHandler)PUBLIC:
Set the exceptionHandler.
Exception handler can catch errors that occur on queries or during database access.
|
public void | setExternalTransactionController(oracle.toplink.essentials.sessions.ExternalTransactionController externalTransactionController)Set the transaction controller, allow integration with JTA.
|
public void | setIntegrityChecker(oracle.toplink.essentials.exceptions.IntegrityChecker integrityChecker)PUBLIC:
Set the integrityChecker, the integrityChecker holds all the Descriptor Exceptions.
|
public void | setLog(java.io.Writer log)PUBLIC:
Set the writer to which an accessor writes logged messages and SQL.
If not set, this reference defaults to a writer on System.out.
|
public void | setLogLevel(int level)PUBLIC:
Set the log level
|
public void | setName(java.lang.String name)PUBLIC:
Set the name of the session.
This is used with the session broker, or to give the session a more meaningful name.
|
public void | setProfiler(oracle.toplink.essentials.sessions.SessionProfiler profiler)PUBLIC:
Set the profiler for the session.
This allows for performance operations to be profiled.
|
public void | setProperty(java.lang.String propertyName, java.lang.Object propertyValue)PUBLIC:
Allow for user defined properties.
|
public void | setSessionLog(oracle.toplink.essentials.logging.SessionLog sessionLog)PUBLIC:
Set the session log to which an accessor logs messages and SQL.
If not set, this will default to a session log on a writer on System.out.
To enable logging, logMessages must be turned on.
|
public boolean | shouldLog(int Level, java.lang.String category)PUBLIC:
Check if a message of the given level would actually be logged.
|
public boolean | shouldLogMessages()PUBLIC:
Return if logging is enabled (false if log level is OFF)
|