public abstract class AbstractSession extends CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager> implements Session, CommandProcessor, java.io.Serializable, java.lang.Cloneable
Purpose: Define the interface and common protocol of an EclipseLink compliant session.
Description: The session is the primary interface into EclipseLink,
the application should do all of its reading and writing of objects through the session.
The session also manages transactions and units of work. Normally the session
is passed and used by the application controller objects. Controller objects normally
sit behind the GUI and perform the business processes required for the application,
they should perform all explicit database access and database access should be avoided from
the domain object model. Do not use a globally accessible session instance, doing so does
not allow for multiple sessions. Multiple sessions may required when performing things like
data migration or multiple database access, as well the unit of work feature requires the usage
of multiple session instances. Although session is abstract, any users of its subclasses
should only cast the variables to Session to allow usage of any of its subclasses.
Responsibilities:
- Connecting/disconnecting.
- Reading and writing objects.
- Transaction and unit of work support.
- Identity maps and caching.
,
DatabaseSessionImpl
,
Serialized FormLOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
Constructor and Description |
---|
AbstractSession(Login login)
PUBLIC:
Create and return a new session.
|
AbstractSession(Project project)
PUBLIC:
Create and return a new session.
|
Modifier and Type | Method and Description |
---|---|
Session |
acquireHistoricalSession(AsOfClause clause)
INTERNAL:
Constructs a HistoricalSession given a valid AsOfClause.
|
UnitOfWorkImpl |
acquireNonSynchronizedUnitOfWork()
INTERNAL:
Return a unit of work for this session not registered with the JTS transaction.
|
UnitOfWorkImpl |
acquireNonSynchronizedUnitOfWork(ReferenceMode referenceMode)
INTERNAL:
Return a unit of work for this session not registered with the JTS transaction.
|
RepeatableWriteUnitOfWork |
acquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)
PUBLIC:
Return a repeatable write unit of work for this session.
|
UnitOfWorkImpl |
acquireUnitOfWork()
PUBLIC:
Return a unit of work for this session.
|
UnitOfWorkImpl |
acquireUnitOfWork(ReferenceMode referenceMode)
PUBLIC:
Return a unit of work for this session.
|
void |
addAlias(java.lang.String alias,
ClassDescriptor descriptor)
PUBLIC:
Add an alias for the descriptor
|
void |
addJPAQuery(DatabaseQuery query)
INTERNAL:
Return all pre-defined not yet parsed EJBQL queries.
|
void |
addJPATablePerTenantQuery(DatabaseQuery query)
INTERNAL:
Return all pre-defined not yet parsed EJBQL multitenant queries.
|
void |
addMultitenantContextProperty(java.lang.String contextProperty)
PUBLIC:
Return a set of multitenant context properties this session
|
void |
addQuery(java.lang.String name,
DatabaseQuery query)
PUBLIC:
Add the query to the session queries with the given name.
|
void |
addQuery(java.lang.String name,
DatabaseQuery query,
boolean replace)
PUBLIC:
Add the query to the session queries with the given name.
|
void |
addStaticMetamodelClass(java.lang.String modelClassName,
java.lang.String metamodelClassName)
INTERNAL:
Add a metamodel class to model class reference.
|
java.lang.Object |
basicExecuteCall(Call call,
AbstractRecord translationRow,
DatabaseQuery query)
INTERNAL:
Execute the call on each accessors and merge the results.
|
boolean |
beginExternalTransaction()
INTERNAL:
Attempts to begin an external transaction.
|
void |
beginTransaction()
PUBLIC:
Begin a transaction on the database.
|
void |
checkAndRefreshInvalidObject(java.lang.Object object,
CacheKey cacheKey,
ClassDescriptor descriptor)
INTERNAL:
Check if the object is invalid and refresh it.
|
void |
cleanUpEntityListenerInjectionManager()
allow the entity listener injection manager to clean itself up.
|
void |
clearDescriptors()
INTERNAL:
Clear the the descriptors cache.
|
void |
clearIntegrityChecker()
PUBLIC:
clear the integrityChecker.
|
void |
clearLastDescriptorAccessed()
INTERNAL:
Clear the the lastDescriptorAccessed cache.
|
void |
clearProfile()
PUBLIC:
Clear the profiler, this will end the current profile operation.
|
java.lang.Object |
clone()
INTERNAL:
Clones the descriptor
|
boolean |
commitExternalTransaction()
INTERNAL:
Attempts to commit the running internally started external transaction.
|
void |
commitTransaction()
PUBLIC:
Commit the active database transaction.
|
boolean |
compareObjects(java.lang.Object firstObject,
java.lang.Object secondObject)
INTERNAL:
Return if the two object match completely.
|
boolean |
compareObjectsDontMatch(java.lang.Object firstObject,
java.lang.Object secondObject)
TESTING:
Return true if the object do not match.
|
void |
config(java.lang.String message,
java.lang.String category)
PUBLIC:
|
boolean |
containsQuery(java.lang.String queryName)
PUBLIC:
Return true if the pre-defined query is defined on the session.
|
java.lang.Object |
copy(java.lang.Object originalObjectOrObjects)
PUBLIC:
Return a complete copy of the object or of collection of objects.
|
java.lang.Object |
copy(java.lang.Object originalObjectOrObjects,
AttributeGroup group)
PUBLIC:
Return a complete copy of the object or of collection of objects.
|
void |
copyDescriptorNamedQueries(boolean allowSameQueryNameDiffArgsCopyToSession)
INTERNAL:
This method will be used to copy all EclipseLink named queries defined in descriptors into the session.
|
void |
copyDescriptorsFromProject()
INTERNAL:
Copies descriptors cached on the Project.
|
java.lang.Object |
copyInternal(java.lang.Object originalObject,
CopyGroup copyGroup)
INTERNAL:
|
java.lang.Object |
copyObject(java.lang.Object original)
Deprecated.
since EclipseLink 2.1, replaced by copy(Object)
|
java.lang.Object |
copyObject(java.lang.Object original,
ObjectCopyingPolicy policy)
Deprecated.
since EclipseLink 2.1, replaced by copy(Object, AttributeGroup)
|
java.util.Vector |
copyReadOnlyClasses()
INTERNAL:
Copy the read only classes from the unit of work
Added Nov 8, 2000 JED for Patch 2.5.1.8
Ref: Prs 24502
|
DatabaseValueHolder |
createCloneQueryValueHolder(ValueHolderInterface attributeValue,
java.lang.Object clone,
AbstractRecord row,
ForeignReferenceMapping mapping) |
DatabaseValueHolder |
createCloneTransformationValueHolder(ValueHolderInterface attributeValue,
java.lang.Object original,
java.lang.Object clone,
AbstractTransformationMapping mapping) |
EntityListenerInjectionManager |
createEntityListenerInjectionManager(java.lang.Object beanManager) |
java.lang.Object |
createProtectedInstanceFromCachedData(java.lang.Object cached,
java.lang.Integer refreshCascade,
ClassDescriptor descriptor)
INTERNAL:
This method is similar to getAndCloneCacheKeyFromParent.
|
void |
deferEvent(DescriptorEvent event)
INTERNAL:
Add an event to the deferred list.
|
void |
deleteAllObjects(java.util.Collection domainObjects)
PUBLIC:
delete all of the objects and all of their privately owned parts in the database.
|
void |
deleteAllObjects(java.util.Vector domainObjects)
Deprecated.
|
java.lang.Object |
deleteObject(java.lang.Object domainObject)
PUBLIC:
Delete the object and all of its privately owned parts from the database.
|
boolean |
doesObjectExist(java.lang.Object object)
PUBLIC:
Return if the object exists on the database or not.
|
void |
dontLogMessages()
PUBLIC:
Turn off logging
|
void |
endOperationProfile(java.lang.String operationName)
INTERNAL:
End the operation timing.
|
void |
endOperationProfile(java.lang.String operationName,
DatabaseQuery query,
int weight)
INTERNAL:
End the operation timing.
|
java.lang.Object |
executeCall(Call call,
AbstractRecord translationRow,
DatabaseQuery query)
INTERNAL:
Overridden by subclasses that do more than just execute the call.
|
void |
executeDeferredEvents()
INTERNAL:
Causes any deferred events to be fired.
|
int |
executeNonSelectingCall(Call call)
PUBLIC:
Execute the call on the database.
|
void |
executeNonSelectingSQL(java.lang.String sqlString)
PUBLIC:
Execute the sql on the database.
|
java.lang.Object |
executeQuery(DatabaseQuery query)
PUBLIC:
Execute the database query.
|
java.lang.Object |
executeQuery(DatabaseQuery query,
AbstractRecord row)
INTERNAL:
Return the results from executing the database query.
|
java.lang.Object |
executeQuery(DatabaseQuery query,
AbstractRecord row,
int retryCount)
INTERNAL:
Return the results from executing the database query.
|
java.lang.Object |
executeQuery(DatabaseQuery query,
java.util.List argumentValues)
PUBLIC:
Return the results from executing the database query.
|
java.lang.Object |
executeQuery(java.lang.String queryName)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
java.lang.Object |
executeQuery(java.lang.String queryName,
java.lang.Class domainClass)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
java.lang.Object |
executeQuery(java.lang.String queryName,
java.lang.Class domainClass,
java.util.List argumentValues)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
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.
|
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.
|
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.
|
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.
|
java.lang.Object |
executeQuery(java.lang.String queryName,
java.util.List argumentValues)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
java.lang.Object |
executeQuery(java.lang.String queryName,
java.lang.Object arg1)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
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.
|
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.
|
java.lang.Object |
executeQuery(java.lang.String queryName,
java.util.Vector argumentValues)
PUBLIC:
Execute the pre-defined query by name and return the result.
|
java.util.Vector |
executeSelectingCall(Call call)
PUBLIC:
Execute the call on the database and return the result.
|
java.util.Vector |
executeSQL(java.lang.String sqlString)
PUBLIC:
Execute the sql on the database and return the result.
|
void |
fine(java.lang.String message,
java.lang.String category)
PUBLIC:
|
void |
finer(java.lang.String message,
java.lang.String category)
PUBLIC:
|
void |
finest(java.lang.String message,
java.lang.String category)
PUBLIC:
|
Accessor |
getAccessor()
INTERNAL:
This should normally not be used, most sessions do not have a single accessor.
|
java.util.Collection<Accessor> |
getAccessors()
INTERNAL:
This should normally not be used, most sessions do not have specific accessors.
|
java.util.Collection<Accessor> |
getAccessors(Call call,
AbstractRecord translationRow,
DatabaseQuery query)
INTERNAL:
Return the connections to use for the query execution.
|
ExposedNodeLinkedList |
getActiveCommandThreads()
INTERNAL:
|
Session |
getActiveSession()
PUBLIC:
Return the active session for the current active external (JTS) transaction.
|
UnitOfWork |
getActiveUnitOfWork()
PUBLIC:
Return the active unit of work for the current active external (JTS) transaction.
|
java.util.Map |
getAliasDescriptors()
INTERNAL:
Returns the alias descriptors Map.
|
java.util.List<DatabaseQuery> |
getAllQueries()
INTERNAL:
Return the pre-defined queries in this session.
|
AsOfClause |
getAsOfClause()
ADVANCED:
Answers the past time this session is as of.
|
java.util.Map<java.lang.String,AttributeGroup> |
getAttributeGroups()
ADVANCED
Return all predefined attribute groups
|
AbstractSession |
getBroker()
INTERNAL:
Allow the session to be used from a session broker.
|
ClassDescriptor |
getClassDescriptor(java.lang.Class theClass)
ADVANCED:
Return the descriptor specified for the class.
|
ClassDescriptor |
getClassDescriptor(java.lang.Object domainObject)
ADVANCED:
Return the descriptor specified for the object's class.
|
ClassDescriptor |
getClassDescriptorForAlias(java.lang.String alias)
PUBLIC:
Return the descriptor for the alias.
|
CommandManager |
getCommandManager()
PUBLIC:
Return the CommandManager that allows this session to act as a
CommandProcessor and receive or propagate commands from/to the
EclipseLink cluster.
|
CommitManager |
getCommitManager()
INTERNAL:
The commit manager is used to resolve referential integrity on commits of multiple objects.
|
Login |
getDatasourceLogin()
PUBLIC:
Return the login, the login holds any database connection information given.
|
Platform |
getDatasourcePlatform()
INTERNAL:
Return the database platform currently connected to.
|
java.util.Vector |
getDefaultReadOnlyClasses()
INTERNAL:
Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.
|
ReferenceMode |
getDefaultReferenceMode()
Stores the default Session wide reference mode that a UnitOfWork will use when referencing
managed objects.
|
ClassDescriptor |
getDescriptor(java.lang.Class theClass)
ADVANCED:
Return the descriptor specified for the class.
|
ClassDescriptor |
getDescriptor(java.lang.Object domainObject)
ADVANCED:
Return the descriptor specified for the object's class.
|
ClassDescriptor |
getDescriptorForAlias(java.lang.String alias)
PUBLIC:
Return the descriptor for the alias.
|
java.util.Map<java.lang.Class,ClassDescriptor> |
getDescriptors()
ADVANCED:
Return all registered descriptors.
|
EntityListenerInjectionManager |
getEntityListenerInjectionManager() |
SessionEventManager |
getEventManager()
PUBLIC:
Return the event manager.
|
ExceptionHandler |
getExceptionHandler()
PUBLIC:
Return the ExceptionHandler.Exception handler can catch errors that occur on queries or during database access.
|
java.lang.String |
getExceptionHandlerClass()
INTERNAL:
Return a string which represents my ExceptionHandler's class
Added for F2104: Properties.xml
- gn
|
AbstractSession |
getExecutionSession(DatabaseQuery query)
INTERNAL:
Gets the session which this query will be executed on.
|
ExternalTransactionController |
getExternalTransactionController()
PUBLIC:
Used for JTS integration.
|
java.lang.Object |
getId(java.lang.Object domainObject)
ADVANCED:
Extract and return the primary key from the object.
|
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.
|
IdentityMapAccessor |
getIdentityMapAccessorInstance()
INTERNAL:
Return the internally available IdentityMapAccessor instance.
|
IntegrityChecker |
getIntegrityChecker()
PUBLIC:
Returns the integrityChecker.IntegrityChecker holds all the ClassDescriptor Exceptions.
|
java.util.List<DatabaseQuery> |
getJPAQueries()
ADVANCED:
Return all pre-defined not yet parsed JPQL queries.
|
java.util.List<DatabaseQuery> |
getJPATablePerTenantQueries()
ADVANCED:
Return all pre-defined not yet parsed JPQL queries.
|
java.lang.ClassLoader |
getLoader()
INTERNAL:
Return the class loader for the session's application.
|
java.io.Writer |
getLog()
PUBLIC:
Return the writer to which an accessor writes logged messages and SQL.
|
DatabaseLogin |
getLogin()
OBSOLETE:
Return the login, the login holds any database connection information given.
|
int |
getLogLevel()
PUBLIC:
|
int |
getLogLevel(java.lang.String category)
PUBLIC:
|
java.lang.String |
getLogSessionString()
INTERNAL:
Return the name of the session: class name + system hashcode.
|
ClassDescriptor |
getMappedSuperclass(java.lang.String className)
INTERNAL:
Return the mapped superclass descriptor if one exists for the given
class name.
|
java.util.Set<java.lang.String> |
getMultitenantContextProperties()
PUBLIC:
Return a set of multitenant context properties this session
|
java.lang.String |
getName()
PUBLIC:
Return the name of the session.
|
long |
getNextQueryId()
INTERNAL:
Called by a sessions queries to obtain individual query ids.
|
java.lang.Number |
getNextSequenceNumberValue(java.lang.Class domainClass)
ADVANCED:
Return the sequnce number from the database
|
int |
getNumberOfActiveUnitsOfWork()
INTERNAL:
Return the number of units of work connected.
|
AbstractSession |
getParent()
INTERNAL:
Gets the parent session.
|
AbstractSession |
getParentIdentityMapSession(ClassDescriptor descriptor,
boolean canReturnSelf,
boolean terminalOnly)
INTERNAL:
Returns the appropriate IdentityMap session for this descriptor.
|
AbstractSession |
getParentIdentityMapSession(DatabaseQuery query)
INTERNAL:
Gets the next link in the chain of sessions followed by a query's check
early return, the chain of sessions with identity maps all the way up to
the root session.
|
AbstractSession |
getParentIdentityMapSession(DatabaseQuery query,
boolean canReturnSelf,
boolean terminalOnly)
INTERNAL:
Gets the next link in the chain of sessions followed by a query's check
early return, the chain of sessions with identity maps all the way up to
the root session.
|
PartitioningPolicy |
getPartitioningPolicy()
PUBLIC:
Return the session's partitioning policy.
|
java.lang.Integer |
getPessimisticLockTimeoutDefault()
INTERNAL:
Returns the default pessimistic lock timeout value.
|
DatabasePlatform |
getPlatform()
INTERNAL:
Return the database platform currently connected to.
|
Platform |
getPlatform(java.lang.Class domainClass)
INTERNAL:
Return the database platform currently connected to
for specified class.
|
SessionProfiler |
getProfiler()
PUBLIC:
Return the profiler.
|
Project |
getProject()
PUBLIC:
Return the project, the project holds configuartion information including the descriptors.
|
java.util.Map |
getProperties()
ADVANCED:
Allow for user defined properties.
|
java.lang.Object |
getProperty(java.lang.String name)
ADVANCED:
Returns the user defined property.
|
java.util.Map<java.lang.String,java.util.List<DatabaseQuery>> |
getQueries()
ADVANCED:
Return all pre-defined queries.
|
DatabaseQuery |
getQuery(java.lang.String name)
PUBLIC:
Return the query from the session pre-defined queries with the given name.
|
DatabaseQuery |
getQuery(java.lang.String name,
java.util.List arguments)
PUBLIC:
Return the query from the session pre-defined queries with the given name and argument types.
|
DatabaseQuery |
getQuery(java.lang.String name,
java.util.Vector arguments)
PUBLIC:
Return the query from the session pre-defined queries with the given name and argument types.
|
DatabaseQuery |
getQuery(java.lang.String name,
java.util.Vector arguments,
boolean shouldSearchParent)
INTERNAL:
Return the query from the session pre-defined queries with the given name and argument types.
|
JPAQueryBuilder |
getQueryBuilder()
INTERNAL
Return the query builder used to parser JPQL.
|
int |
getQueryTimeoutDefault()
PUBLIC:
Return the default query timeout for this session.
|
MetadataRefreshListener |
getRefreshMetadataListener()
INTERNAL:
This currently only used by JPA with RCM to force a refresh of the metadata used within EntityManagerFactoryWrappers
|
AbstractSession |
getRootSession(DatabaseQuery query)
INTERNAL:
The session that this query is executed against when not in transaction.
|
Sequencing |
getSequencing()
INTERNAL:
Return the Sequencing object used by the session.
|
Serializer |
getSerializer()
Return the Serializer to use by default for serialization.
|
ServerPlatform |
getServerPlatform()
INTERNAL:
Marked internal as this is not customer API but helper methods for
accessing the server platform from within EclipseLink's other sessions types
(ie not DatabaseSession)
|
AbstractSession |
getSessionForClass(java.lang.Class domainClass)
INTERNAL:
Return the session to be used for the class.
|
AbstractSession |
getSessionForName(java.lang.String name)
INTERNAL:
Return the session by name.
|
SessionLog |
getSessionLog()
PUBLIC:
Return the session log to which an accessor logs messages and SQL.
|
java.lang.String |
getSessionTypeString()
INTERNAL:
Returns the type of session, its class.
|
java.lang.String |
getStaticMetamodelClass(java.lang.String modelClassName)
INTERNAL:
Return the static metamodel class associated with the given model class
if available.
|
java.util.List<ClassDescriptor> |
getTablePerTenantDescriptors()
INTERNAL:
Return list of table per tenant multitenant descriptors.
|
java.util.List<DatabaseQuery> |
getTablePerTenantQueries()
INTERNAL:
Return list of table per tenant multitenant descriptors.
|
ConcurrencyManager |
getTransactionMutex()
INTERNAL:
The transaction mutex ensure mutual exclusion on transaction across multiple threads.
|
java.lang.Object |
handleException(java.lang.RuntimeException exception)
PUBLIC:
Allow any WARNING level exceptions that occur within EclipseLink to be logged and handled by the exception handler.
|
java.lang.Object |
handleSevere(java.lang.RuntimeException exception)
PUBLIC:
Allow any SEVERE level exceptions that occur within EclipseLink to be logged and handled by the exception handler.
|
boolean |
hasBroker()
INTERNAL:
Allow the session to be used from a session broker.
|
boolean |
hasCommitManager()
INTERNAL:
Return if the commit manager has been set.
|
boolean |
hasDescriptor(java.lang.Class theClass)
ADVANCED:
Return true if a descriptor exists for the given class.
|
boolean |
hasEventManager()
INTERNAL:
Return if an event manager has been set.
|
boolean |
hasExceptionHandler()
PUBLIC:
Return if an exception handler is present.
|
boolean |
hasExternalTransactionController()
PUBLIC:
Used for JTA integration.
|
boolean |
hasProperties()
INTERNAL:
Allow to check for user defined properties.
|
boolean |
hasTablePerTenantDescriptors()
INTERNAL:
Return list of table per tenant multitenant descriptors.
|
boolean |
hasTablePerTenantQueries()
INTERNAL:
Return a list of table per tenant multitenant queries.
|
void |
incrementProfile(java.lang.String operationName)
INTERNAL:
Updates the count of SessionProfiler event
|
void |
incrementProfile(java.lang.String operationName,
DatabaseQuery query)
INTERNAL:
Updates the count of SessionProfiler event
|
void |
info(java.lang.String message,
java.lang.String category)
PUBLIC:
|
void |
initializeIdentityMapAccessor()
INTERNAL:
Set up the IdentityMapManager.
|
java.lang.Object |
insertObject(java.lang.Object domainObject)
PUBLIC:
Insert the object and all of its privately owned parts into the database.
|
java.lang.Object |
internalExecuteQuery(DatabaseQuery query,
AbstractRecord databaseRow)
INTERNAL:
Return the results from exeucting the database query.
|
boolean |
isBroker()
INTERNAL:
Returns true if the session is a session Broker.
|
boolean |
isClassReadOnly(java.lang.Class theClass)
PUBLIC:
Return if the class is defined as read-only.
|
boolean |
isClassReadOnly(java.lang.Class theClass,
ClassDescriptor descriptor)
INTERNAL:
Return if the class is defined as read-only.
|
boolean |
isClientSession()
PUBLIC:
Return if this session is a client session.
|
boolean |
isConcurrent()
ADVANCED:
Return if the session enables concurrent processing.
|
boolean |
isConnected()
PUBLIC:
Return if this session is connected to the database.
|
boolean |
isConsideredInvalid(java.lang.Object object,
CacheKey cacheKey,
ClassDescriptor descriptor)
INTERNAL:
Check if the object is invalid and *should* be refreshed.
|
boolean |
isDatabaseSession()
PUBLIC:
Return if this session is a database session.
|
boolean |
isDistributedSession()
PUBLIC:
Return if this session is a distributed session.
|
boolean |
isExclusiveConnectionRequired()
INTERNAL:
This method is called in case externalConnectionPooling is used.
|
boolean |
isExclusiveIsolatedClientSession()
PUBLIC:
Return if this session is an exclusive isolated client session.
|
boolean |
isFinalizersEnabled()
PUBLIC:
Return if this session's decendants should use finalizers.
|
boolean |
isHistoricalSession()
INTERNAL:
Return if this session is a historical session.
|
boolean |
isInBroker()
INTERNAL:
Returns true if the session is in a session Broker.
|
boolean |
isInProfile()
PUBLIC:
Return if a profiler is being used.
|
boolean |
isInTransaction()
PUBLIC:
Return if the session is currently in the progress of a database transaction.
|
boolean |
isIsolatedClientSession()
PUBLIC:
Return if this session is an isolated client session.
|
boolean |
isJPAQueriesProcessed()
INTERNAL:
used to see if JPA Queries have been processed during initialization
|
boolean |
isLoggingOff()
INTERNAL:
PERF: Used for quick check if logging is OFF entirely.
|
boolean |
isProtectedSession()
PUBLIC:
Returns true if Protected Entities should be built within this session
|
boolean |
isRemoteSession()
PUBLIC:
Return if this session is remote.
|
boolean |
isRemoteUnitOfWork()
PUBLIC:
Return if this session is a unit of work.
|
boolean |
isServerSession()
PUBLIC:
Return if this session is a server session.
|
boolean |
isSessionBroker()
PUBLIC:
Return if this session is a session broker.
|
boolean |
isSynchronized()
INTERNAL:
Return if this session is synchronized.
|
boolean |
isUnitOfWork()
PUBLIC:
Return if this session is a unit of work.
|
java.util.Vector |
keyFromObject(java.lang.Object domainObject)
Deprecated.
since EclipseLink 2.1, replaced by getId(Object)
|
java.lang.Object |
keyFromObject(java.lang.Object domainObject,
ClassDescriptor descriptor)
ADVANCED:
Extract and return the primary key from the object.
|
void |
load(java.lang.Object objectOrCollection,
AttributeGroup group)
This method will load the passed object or collection of objects using the passed AttributeGroup.
|
void |
load(java.lang.Object objectOrCollection,
AttributeGroup group,
ClassDescriptor referenceDescriptor,
boolean fromFetchGroup)
This method will load the passed object or collection of objects using the passed AttributeGroup.
|
void |
log(int level,
java.lang.String message,
java.lang.Object[] params,
Accessor accessor)
Deprecated.
since 2.6 replaced by log with category, log(int, String, String, Object[], Accessor)
|
void |
log(int level,
java.lang.String message,
java.lang.Object[] params,
Accessor accessor,
boolean shouldTranslate)
Deprecated.
since 2.6 replaced by log with category, log(int, String, String, Object[], Accessor, boolean)
|
void |
log(int level,
java.lang.String category,
java.lang.String message)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object param)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object[] params)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object[] params,
Accessor accessor)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object[] params,
Accessor accessor,
boolean shouldTranslate)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2)
PUBLIC:
|
void |
log(int level,
java.lang.String category,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
PUBLIC:
|
void |
log(SessionLogEntry entry)
PUBLIC:
Log the log entry.
|
void |
logMessage(int logLevel,
java.lang.String message)
INTERNAL:
RemoteCommandManager method.
|
void |
logMessage(java.lang.String message)
Log a untranslated message to the EclipseLink log at FINER level.
|
void |
logThrowable(int level,
java.lang.String category,
java.lang.Throwable throwable)
PUBLIC:
|
void |
postAcquireConnection(Accessor accessor)
INTERNAL:
This method rises appropriate for the session event(s)
right after connection is acquired.
|
DatabaseQuery |
prepareDatabaseQuery(DatabaseQuery query)
INTERNAL:
A call back to do session specific preparation of a query.
|
void |
preReleaseConnection(Accessor accessor)
INTERNAL:
This method rises appropriate for the session event(s)
right before the connection is released.
|
int |
priviledgedExecuteNonSelectingCall(Call call)
INTERNAL:
Execute the call on the database.
|
java.util.Vector |
priviledgedExecuteSelectingCall(Call call)
INTERNAL:
Execute the call on the database and return the result.
|
void |
processCommand(java.lang.Object command)
INTERNAL:
RemoteCommandManager method.
|
void |
processJPAQueries()
INTERNAL:
Process the JPA named queries into EclipseLink Session queries.
|
java.util.Vector |
readAllObjects(java.lang.Class domainClass)
PUBLIC:
Read all of the instances of the class from the database.
|
java.util.Vector |
readAllObjects(java.lang.Class referenceClass,
Call aCall)
PUBLIC:
Read all the instances of the class from the database returned through execution the Call string.
|
java.util.Vector |
readAllObjects(java.lang.Class domainClass,
Expression expression)
PUBLIC:
Read all of the instances of the class from the database matching the given expression.
|
java.util.Vector |
readAllObjects(java.lang.Class domainClass,
java.lang.String sqlString)
PUBLIC:
Read all of the instances of the class from the database return through execution the SQL string.
|
java.lang.Object |
readObject(java.lang.Class domainClass)
PUBLIC:
Read the first instance of the class from the database.
|
java.lang.Object |
readObject(java.lang.Class domainClass,
Call aCall)
PUBLIC:
Read the first instance of the class from the database returned through execution the Call string.
|
java.lang.Object |
readObject(java.lang.Class domainClass,
Expression expression)
PUBLIC:
Read the first instance of the class from the database matching the given expression.
|
java.lang.Object |
readObject(java.lang.Class domainClass,
java.lang.String sqlString)
PUBLIC:
Read the first instance of the class from the database return through execution the SQL string.
|
java.lang.Object |
readObject(java.lang.Object object)
PUBLIC:
Use the example object to consruct a read object query by the objects primary key.
|
java.lang.Object |
refreshAndLockObject(java.lang.Object object)
PUBLIC:
Refresh the attributes of the object and of all of its private parts from the database.
|
java.lang.Object |
refreshAndLockObject(java.lang.Object object,
short lockMode)
PUBLIC:
Refresh the attributes of the object and of all of its private parts from the database.
|
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.
|
void |
registerFinalizer()
INTERNAL:
Register a finalizer to release this session.
|
void |
release()
PUBLIC:
Release the session.
|
void |
releaseConnectionAfterCall(DatabaseQuery query)
INTERNAL:
Release (if required) connection after call.
|
void |
releaseJTSConnection()
INTERNAL:
Called in the end of beforeCompletion of external transaction synchronization listener.
|
void |
releaseReadConnection(Accessor connection)
INTERNAL:
|
void |
releaseUnitOfWork(UnitOfWorkImpl unitOfWork)
INTERNAL:
Release the unit of work, if lazy release the connection.
|
void |
removeProperty(java.lang.String property)
PUBLIC:
Remove the user defined property.
|
void |
removeQuery(java.lang.String queryName)
PUBLIC:
Remove all queries with the given queryName regardless of the argument types.
|
void |
removeQuery(java.lang.String queryName,
java.util.Vector argumentTypes)
PUBLIC:
Remove the specific query with the given queryName and argumentTypes.
|
CacheKey |
retrieveCacheKey(java.lang.Object primaryKey,
ClassDescriptor concreteDescriptor,
JoinedAttributeManager joinManager,
ObjectBuildingQuery query) |
java.lang.Object |
retryQuery(DatabaseQuery query,
AbstractRecord row,
DatabaseException databaseException,
int retryCount,
AbstractSession executionSession)
INTERNAL:
A query execution failed due to an invalid query.
|
DatabaseException |
retryTransaction(Accessor accessor,
DatabaseException databaseException,
int retryCount,
AbstractSession executionSession)
INTERNAL:
A begin transaction failed.
|
void |
rollbackTransaction()
PUBLIC:
Rollback the active database transaction.
|
void |
setAccessor(Accessor accessor)
INTERNAL:
Set the accessor.
|
void |
setBroker(AbstractSession broker)
INTERNAL:
Allow the session to be used from a session broker.
|
void |
setCommandManager(CommandManager mgr)
ADVANCED:
Set the CommandManager that allows this session to act as a
CommandProcessor and receive or propagate commands from/to the
EclipseLink cluster.
|
void |
setCommitManager(CommitManager commitManager)
INTERNAL:
The commit manager is used to resolve referncial integrity on commits of multiple objects.
|
void |
setDatasourceLogin(Login login)
PUBLIC:
Set the login.
|
void |
setDefaultReferenceMode(ReferenceMode defaultReferenceMode)
Stores the default Session wide reference mode that a UnitOfWork will use when referencing
managed objects.
|
void |
setEntityListenerInjectionManager(EntityListenerInjectionManager entityListenerInjectionManager) |
void |
setEventManager(SessionEventManager eventManager)
INTERNAL:
Set the event manager.
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
PUBLIC:
Set the exceptionHandler.
|
void |
setExternalTransactionController(ExternalTransactionController externalTransactionController)
Used for JTS integration internally by ServerPlatform.
|
void |
setIntegrityChecker(IntegrityChecker integrityChecker)
PUBLIC:
set the integrityChecker.
|
void |
setIsConcurrent(boolean isConcurrent)
ADVANCED:
Set if the session enables concurrent processing.
|
void |
setIsFinalizersEnabled(boolean isFinalizersEnabled)
PUBLIC:
Set if this session's decendants should use finalizers.
|
void |
setIsInBroker(boolean isInBroker)
INTERNAL:
Set if this session is contained in a SessionBroker.
|
void |
setIsInProfile(boolean inProfile)
PUBLIC:
Allow for user deactive a profiler
|
void |
setJPAQueriesProcessed(boolean jpaQueriesProcessed)
INTERNAL:
used to set if JPA Queries have been processed during initialization
|
void |
setLog(java.io.Writer log)
PUBLIC:
Set the writer to which an accessor writes logged messages and SQL.
|
void |
setLoggingOff(boolean loggingOff)
INTERNAL:
PERF: Used for quick turning logging ON/OFF entirely.
|
void |
setLogin(DatabaseLogin login)
PUBLIC:
Set the login.
|
void |
setLogin(Login login)
PUBLIC:
Set the login.
|
void |
setLogLevel(int level)
PUBLIC:
|
void |
setName(java.lang.String name)
PUBLIC:
Set the name of the session.
|
void |
setPartitioningPolicy(PartitioningPolicy partitioningPolicy)
PUBLIC:
Set the session's partitioning policy.
|
void |
setPessimisticLockTimeoutDefault(java.lang.Integer pessimisticLockTimeoutDefault)
PUBLIC:
Set the default pessimistic lock timeout value.
|
void |
setProfiler(SessionProfiler profiler)
PUBLIC:
Set the profiler for the session.
|
void |
setProject(Project project)
INTERNAL:
Set the project, the project holds configuration information including the descriptors.
|
void |
setProperties(java.util.Map<java.lang.Object,java.lang.Object> propertiesMap)
INTERNAL:
Set the user defined properties by shallow copying the propertiesMap.
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
PUBLIC: Allow for user defined properties.
|
void |
setQueries(java.util.Map<java.lang.String,java.util.List<DatabaseQuery>> queries)
INTERNAL:
Set the named queries.
|
void |
setQueryBuilder(JPAQueryBuilder queryBuilder)
INTERNAL
Set the query builder used to parser JPQL.
|
void |
setQueryTimeoutDefault(int queryTimeoutDefault)
PUBLIC:
Set the default query timeout for this session.
|
void |
setRefreshMetadataListener(MetadataRefreshListener metadatalistener) |
void |
setSerializer(Serializer serializer)
Set the Serializer to use by default for serialization.
|
void |
setSessionLog(SessionLog sessionLog)
PUBLIC:
Set the session log to which an accessor logs messages and SQL.
|
void |
setShouldOptimizeResultSetAccess(boolean shouldOptimizeResultSetAccess)
ADVANCED:
Set to indicate whether ObjectLevelReadQuery should by default use ResultSet Access optimization.
|
void |
setShouldPropagateChanges(boolean choice)
ADVANCED:
Set whether changes should be propagated to other sessions or applications
in a EclipseLink cluster through the Remote Command Manager mechanism.
|
void |
setSynchronized(boolean synched)
INTERNAL:
Set isSynchronized flag to indicate that this session is synchronized.
|
void |
setTolerateInvalidJPQL(boolean b)
ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time.
|
void |
setWasJTSTransactionInternallyStarted(boolean wasJTSTransactionInternallyStarted)
INTERNAL:
Return if a JTS transaction was started by the session.
|
void |
severe(java.lang.String message,
java.lang.String category)
PUBLIC:
|
boolean |
shouldDisplayData()
PUBLIC:
Return true if SQL logging should log visible bind parameters.
|
boolean |
shouldLog(int Level,
java.lang.String category)
PUBLIC:
|
boolean |
shouldLogMessages()
PUBLIC:
Return if logging is enabled (false if log level is OFF)
|
boolean |
shouldLogMessages(int logLevel)
INTERNAL:
RemoteCommandManager method.
|
boolean |
shouldOptimizeResultSetAccess()
ADVANCED:
Indicates whether ObjectLevelReadQuery should by default use ResultSet Access optimization.
|
boolean |
shouldPropagateChanges()
PUBLIC:
Return whether changes should be propagated to other sessions or applications
in a EclipseLink cluster through the Remote Command Manager mechanism.
|
boolean |
shouldTolerateInvalidJPQL()
ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time.
|
void |
startOperationProfile(java.lang.String operationName)
INTERNAL:
Start the operation timing.
|
void |
startOperationProfile(java.lang.String operationName,
DatabaseQuery query,
int weight)
INTERNAL:
Start the operation timing.
|
java.lang.String |
toString()
Print the connection status with the session.
|
java.lang.Object |
unwrapObject(java.lang.Object proxy)
INTERNAL:
Unwrap the object if required.
|
java.lang.Object |
updateObject(java.lang.Object domainObject)
PUBLIC:
Update the object and all of its privately owned parts in the database.
|
void |
updateProfile(java.lang.String operationName,
java.lang.Object value)
INTERNAL:
Updates the value of SessionProfiler state
|
void |
updateTablePerTenantDescriptors(java.lang.String property,
java.lang.Object value)
INTERNAL:
Set the table per tenant.
|
void |
validateCache()
ADVANCED:
This can be used to help debugging an object identity problem.
|
void |
validateQuery(DatabaseQuery query)
INTERNAL:
This method will be used to update the query with any settings required
For this session.
|
boolean |
verifyDelete(java.lang.Object domainObject)
TESTING:
This is used by testing code to ensure that a deletion was successful.
|
void |
warning(java.lang.String message,
java.lang.String category)
PUBLIC:
|
boolean |
wasJTSTransactionInternallyStarted()
INTERNAL:
Return if a JTS transaction was started by the session.
|
java.lang.Object |
wrapObject(java.lang.Object implementation)
INTERNAL:
Wrap the object if required.
|
java.lang.Object |
writeObject(java.lang.Object domainObject)
PUBLIC:
Write the object and all of its privately owned parts in the database.
|
void |
writesCompleted()
INTERNAL:
This method notifies the accessor that a particular sets of writes has
completed.
|
public AbstractSession(Login login)
public AbstractSession(Project project)
public Serializer getSerializer()
getSerializer
in interface Session
public void setSerializer(Serializer serializer)
setSerializer
in interface Session
public JPAQueryBuilder getQueryBuilder()
public void setQueryBuilder(JPAQueryBuilder queryBuilder)
public void setLoggingOff(boolean loggingOff)
loggingOff
- Logging is turned off when true
and turned on when false
.public boolean isLoggingOff()
public long getNextQueryId()
public UnitOfWorkImpl acquireNonSynchronizedUnitOfWork()
public UnitOfWorkImpl acquireNonSynchronizedUnitOfWork(ReferenceMode referenceMode)
public Session acquireHistoricalSession(AsOfClause clause) throws ValidationException
acquireHistoricalSession
in interface Session
clause
- Represents a valid snap shot time.ValidationException
- if this
not a ClientSession, plain Session, or SessionBroker.AsOfClause
,
Expression.asOf(org.eclipse.persistence.history.AsOfClause)
,
ObjectLevelReadQuery.setAsOfClause(org.eclipse.persistence.history.AsOfClause)
,
HistoryPolicy
public UnitOfWorkImpl acquireUnitOfWork()
acquireUnitOfWork
in interface Session
UnitOfWorkImpl
public RepeatableWriteUnitOfWork acquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)
RepeatableWriteUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
acquireUnitOfWork
in interface Session
referenceMode
- The reference type the UOW should use internally when
referencing Working clones. Setting this to WEAK means the UOW will use
weak references to reference clones that support active object change
tracking and hard references for deferred change tracked objects.
Setting to FORCE_WEAK means that all objects will be referenced by weak
references and if the application no longer references the clone the
clone may be garbage collected. If the clone
has uncommitted changes then those changes will be lost.UnitOfWorkImpl
public void addAlias(java.lang.String alias, ClassDescriptor descriptor)
public void addJPAQuery(DatabaseQuery query)
addJPAQuery
in interface Session
public void addJPATablePerTenantQuery(DatabaseQuery query)
public void addMultitenantContextProperty(java.lang.String contextProperty)
public void addQuery(java.lang.String name, DatabaseQuery query)
public void addQuery(java.lang.String name, DatabaseQuery query, boolean replace)
public void addStaticMetamodelClass(java.lang.String modelClassName, java.lang.String metamodelClassName)
public DatabaseException retryTransaction(Accessor accessor, DatabaseException databaseException, int retryCount, AbstractSession executionSession)
public void releaseJTSConnection()
public boolean beginExternalTransaction()
public void beginTransaction() throws DatabaseException, ConcurrencyException
DatabaseException
- if the database connection is lost or the begin is rejected.ConcurrencyException
- if this session's transaction is acquired by another thread and a timeout occurs.isInTransaction()
public void cleanUpEntityListenerInjectionManager()
public void clearIntegrityChecker()
clearIntegrityChecker
in interface Session
public void clearLastDescriptorAccessed()
public void clearDescriptors()
public void clearProfile()
clearProfile
in interface Session
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean commitExternalTransaction()
public void commitTransaction() throws DatabaseException, ConcurrencyException
DatabaseException
- most databases validate changes as they are done,
normally errors do not occur on commit unless the disk fails or the connection is lost.ConcurrencyException
- if this session is not within a transaction.public boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject)
public boolean compareObjectsDontMatch(java.lang.Object firstObject, java.lang.Object secondObject)
public boolean containsQuery(java.lang.String queryName)
containsQuery
in interface Session
public java.lang.Object copy(java.lang.Object originalObjectOrObjects)
copy
in interface Session
copy(Object, AttributeGroup)
public java.lang.Object copy(java.lang.Object originalObjectOrObjects, AttributeGroup group)
public java.lang.Object copyInternal(java.lang.Object originalObject, CopyGroup copyGroup)
public java.lang.Object copyObject(java.lang.Object original)
copyObject
in interface Session
copyObject(Object, ObjectCopyingPolicy)
,
copy(Object)
public java.lang.Object copyObject(java.lang.Object original, ObjectCopyingPolicy policy)
copyObject
in interface Session
copy(Object, AttributeGroup)
public java.util.Vector copyReadOnlyClasses()
public DatabaseValueHolder createCloneQueryValueHolder(ValueHolderInterface attributeValue, java.lang.Object clone, AbstractRecord row, ForeignReferenceMapping mapping)
public DatabaseValueHolder createCloneTransformationValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, AbstractTransformationMapping mapping)
public EntityListenerInjectionManager createEntityListenerInjectionManager(java.lang.Object beanManager)
public java.lang.Object createProtectedInstanceFromCachedData(java.lang.Object cached, java.lang.Integer refreshCascade, ClassDescriptor descriptor)
public void checkAndRefreshInvalidObject(java.lang.Object object, CacheKey cacheKey, ClassDescriptor descriptor)
public boolean isConsideredInvalid(java.lang.Object object, CacheKey cacheKey, ClassDescriptor descriptor)
public void deferEvent(DescriptorEvent event)
public void deleteAllObjects(java.util.Collection domainObjects) throws DatabaseException, OptimisticLockException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and
the object has been updated or deleted by another user since it was last read.@Deprecated public void deleteAllObjects(java.util.Vector domainObjects) throws DatabaseException, OptimisticLockException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and
the object has been updated or deleted by another user since it was last read.public java.lang.Object deleteObject(java.lang.Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.
An database error is not raised if the object is already deleted or no rows are effected.OptimisticLockException
- if the object's descriptor is using optimistic locking and
the object has been updated or deleted by another user since it was last read.DeleteObjectQuery
public boolean doesObjectExist(java.lang.Object object) throws DatabaseException
doesObjectExist
in interface Session
DatabaseException
public void dontLogMessages()
dontLogMessages
in interface Session
public void endOperationProfile(java.lang.String operationName)
endOperationProfile
in interface CommandProcessor
public void endOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
public void updateProfile(java.lang.String operationName, java.lang.Object value)
updateProfile
in interface CommandProcessor
public void updateTablePerTenantDescriptors(java.lang.String property, java.lang.Object value)
public void incrementProfile(java.lang.String operationName)
incrementProfile
in interface CommandProcessor
public void incrementProfile(java.lang.String operationName, DatabaseQuery query)
public void executeDeferredEvents()
public java.lang.Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException
DatabaseException
public void releaseConnectionAfterCall(DatabaseQuery query)
query
- public int executeNonSelectingCall(Call call) throws DatabaseException
Example:
session.executeNonSelectingCall(new SQLCall("Delete from Employee");
executeNonSelectingCall
in interface Session
DatabaseException
executeSelectingCall(Call)
public void executeNonSelectingSQL(java.lang.String sqlString) throws DatabaseException
Example:
session.executeNonSelectingSQL("Delete from Employee");
executeNonSelectingSQL
in interface Session
DatabaseException
Warning: Allowing an unverified SQL string to be passed into this
method makes your application vulnerable to SQL injection attacks.
public java.lang.Object executeQuery(java.lang.String queryName) throws DatabaseException
executeQuery
in interface Session
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.lang.Object arg1) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.lang.Object arg1, java.lang.Object arg2) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
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) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.List argumentValues) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.Vector argumentValues) throws DatabaseException
DatabaseException
DescriptorQueryManager.addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Object arg1) throws DatabaseException
executeQuery
in interface Session
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Object arg1, java.lang.Object arg2) throws DatabaseException
executeQuery
in interface Session
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3) throws DatabaseException
executeQuery
in interface Session
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.util.List argumentValues) throws DatabaseException
executeQuery
in interface Session
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(java.lang.String queryName, java.util.Vector argumentValues) throws DatabaseException
DatabaseException
addQuery(String, DatabaseQuery)
public java.lang.Object executeQuery(DatabaseQuery query) throws DatabaseException
executeQuery
in interface Session
DatabaseException
DatabaseQuery
public java.lang.Object executeQuery(DatabaseQuery query, java.util.List argumentValues) throws DatabaseException
executeQuery
in interface Session
DatabaseException
public java.lang.Object executeQuery(DatabaseQuery query, AbstractRecord row) throws DatabaseException
DatabaseException
public java.lang.Object executeQuery(DatabaseQuery query, AbstractRecord row, int retryCount) throws DatabaseException
DatabaseException
public java.lang.Object retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)
public java.util.Vector executeSelectingCall(Call call) throws DatabaseException
Example:
session.executeSelectingCall(new SQLCall("Select * from Employee");
executeSelectingCall
in interface Session
DatabaseException
executeNonSelectingCall(Call)
public java.util.Vector executeSQL(java.lang.String sqlString) throws DatabaseException
Example:
session.executeSelectingCall("Select * from Employee");
executeSQL
in interface Session
DatabaseException
executeSelectingCall(Call)
public Accessor getAccessor()
public java.util.Collection<Accessor> getAccessors()
public java.util.Collection<Accessor> getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)
public java.lang.Object basicExecuteCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException
DatabaseException
public ExposedNodeLinkedList getActiveCommandThreads()
public Session getActiveSession()
getActiveSession
in interface Session
public UnitOfWork getActiveUnitOfWork()
getActiveUnitOfWork
in interface Session
public java.util.Map getAliasDescriptors()
public AsOfClause getAsOfClause()
getAsOfClause
in interface Session
null
if no clause set, or this a regular session.acquireHistoricalSession(org.eclipse.persistence.history.AsOfClause)
public AbstractSession getBroker()
public AbstractSession getRootSession(DatabaseQuery query)
In most cases this is the root ServerSession or DatabaseSession.
In cases where objects are not to be cached in the global identity map an alternate session may be returned:
public AbstractSession getParent()
public AbstractSession getParentIdentityMapSession(DatabaseQuery query)
public AbstractSession getParentIdentityMapSession(DatabaseQuery query, boolean canReturnSelf, boolean terminalOnly)
Used for session broker which delegates to registered sessions, or UnitOfWork which checks parent identity map also.
canReturnSelf
- true when method calls itself. If the path
starting at this
is acceptable. Sometimes true if want to
move to the first valid session, i.e. executing on ClientSession when really
should be on ServerSession.terminalOnly
- return the session we will execute the call on, not
the next step towards it.public AbstractSession getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)
canReturnSelf
- true when method calls itself. If the path
starting at this
is acceptable. Sometimes true if want to
move to the first valid session, i.e. executing on ClientSession when really
should be on ServerSession.terminalOnly
- return the last session in the chain where the Enitity is stored.public java.lang.Integer getPessimisticLockTimeoutDefault()
public int getQueryTimeoutDefault()
public EntityListenerInjectionManager getEntityListenerInjectionManager()
public AbstractSession getExecutionSession(DatabaseQuery query)
Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.
Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.
query
- may store session name or reference class for brokers casepublic boolean hasCommitManager()
public CommitManager getCommitManager()
public java.util.Vector getDefaultReadOnlyClasses()
org.eclipse.persistence.sessions.Project#setDefaultReadOnlyClasses(Vector)
public ClassDescriptor getClassDescriptor(java.lang.Class theClass)
getClassDescriptor
in interface Session
public ClassDescriptor getClassDescriptor(java.lang.Object domainObject)
getClassDescriptor
in interface Session
public ClassDescriptor getClassDescriptorForAlias(java.lang.String alias)
getClassDescriptorForAlias
in interface Session
public ClassDescriptor getDescriptor(java.lang.Class theClass)
getDescriptor
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getDescriptor
in interface Session
public ClassDescriptor getDescriptor(java.lang.Object domainObject)
getDescriptor
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getDescriptor
in interface Session
public ClassDescriptor getDescriptorForAlias(java.lang.String alias)
getDescriptorForAlias
in interface Session
alias
- The descriptor alias.The
- descriptor for the alias or null
if no descriptor was found.public java.util.Map<java.lang.Class,ClassDescriptor> getDescriptors()
getDescriptors
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getDescriptors
in interface Session
getDescriptors
in class CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
public boolean hasEventManager()
public SessionEventManager getEventManager()
getEventManager
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getEventManager
in interface Session
public java.lang.String getExceptionHandlerClass()
public ExceptionHandler getExceptionHandler()
getExceptionHandler
in interface Session
public ExternalTransactionController getExternalTransactionController()
getExternalTransactionController
in interface Session
JTATransactionController
public IdentityMapAccessor getIdentityMapAccessor()
getIdentityMapAccessor
in interface Session
public IdentityMapAccessor getIdentityMapAccessorInstance()
public IntegrityChecker getIntegrityChecker()
getIntegrityChecker
in interface Session
public java.util.List<DatabaseQuery> getJPAQueries()
getJPAQueries
in interface Session
public java.util.List<DatabaseQuery> getJPATablePerTenantQueries()
public java.io.Writer getLog()
public java.lang.String getLogSessionString()
This should be the implementation of toString(), and also the value should be calculated in the constructor for it is used all the time. However everything is lazily initialized now and the value is transient for the system hashcode could vary?
public java.lang.String getSessionTypeString()
Override to hide from the user when they are using an internal subclass of a known class.
A user does not need to know that their UnitOfWork is a non-deferred UnitOfWork, or that their ClientSession is an IsolatedClientSession.
public java.lang.String getStaticMetamodelClass(java.lang.String modelClassName)
public DatabaseLogin getLogin()
public Login getDatasourceLogin()
getDatasourceLogin
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getDatasourceLogin
in interface Session
public ClassDescriptor getMappedSuperclass(java.lang.String className)
public java.util.Set<java.lang.String> getMultitenantContextProperties()
public java.lang.String getName()
public java.lang.Number getNextSequenceNumberValue(java.lang.Class domainClass)
getNextSequenceNumberValue
in interface Session
public int getNumberOfActiveUnitsOfWork()
public DatabasePlatform getPlatform()
getPlatform
in interface Session
public java.lang.ClassLoader getLoader()
public Platform getDatasourcePlatform()
getDatasourcePlatform
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getDatasourcePlatform
in interface Session
getDatasourcePlatform
in class CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
public ServerPlatform getServerPlatform()
getServerPlatform
in interface Session
public Platform getPlatform(java.lang.Class domainClass)
getPlatform
in class CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
public SessionProfiler getProfiler()
getProfiler
in interface Session
public Project getProject()
getProject
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
getProject
in interface Session
public java.util.Map getProperties()
getProperties
in interface Session
public boolean hasProperties()
public boolean hasTablePerTenantDescriptors()
public boolean hasTablePerTenantQueries()
public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface Session
public java.util.Map<java.lang.String,java.util.List<DatabaseQuery>> getQueries()
getQueries
in interface Session
public java.util.Map<java.lang.String,AttributeGroup> getAttributeGroups()
public java.util.List<DatabaseQuery> getAllQueries()
getQueries()
public DatabaseQuery getQuery(java.lang.String name)
public DatabaseQuery getQuery(java.lang.String name, java.util.List arguments)
getQuery
in interface Session
getQuery(String)
public DatabaseQuery getQuery(java.lang.String name, java.util.Vector arguments)
getQuery(String)
public DatabaseQuery getQuery(java.lang.String name, java.util.Vector arguments, boolean shouldSearchParent)
#getQuery(String, arguments)
public Sequencing getSequencing()
public AbstractSession getSessionForClass(java.lang.Class domainClass)
public AbstractSession getSessionForName(java.lang.String name) throws ValidationException
ValidationException
public SessionLog getSessionLog()
getSessionLog
in interface Session
#logMessages()
public java.util.List<ClassDescriptor> getTablePerTenantDescriptors()
public java.util.List<DatabaseQuery> getTablePerTenantQueries()
public ConcurrencyManager getTransactionMutex()
public java.lang.Object handleException(java.lang.RuntimeException exception) throws java.lang.RuntimeException
handleException
in interface CommandProcessor
handleException
in interface Session
exception
- The exception being thrownjava.lang.RuntimeException
public boolean hasBroker()
public boolean hasDescriptor(java.lang.Class theClass)
hasDescriptor
in interface Session
public boolean hasExceptionHandler()
hasExceptionHandler
in interface Session
public boolean hasExternalTransactionController()
hasExternalTransactionController
in interface Session
JTATransactionController
public void initializeIdentityMapAccessor()
public java.lang.Object insertObject(java.lang.Object domainObject) throws DatabaseException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.InsertObjectQuery
,
writeObject(Object)
public java.lang.Object internalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow) throws DatabaseException
DatabaseException
public boolean isBroker()
public boolean isInBroker()
public boolean isClassReadOnly(java.lang.Class theClass)
public boolean isClassReadOnly(java.lang.Class theClass, ClassDescriptor descriptor)
public boolean isClientSession()
isClientSession
in interface Session
public boolean isIsolatedClientSession()
public boolean isExclusiveIsolatedClientSession()
public boolean isConnected()
isConnected
in interface Session
public boolean isDatabaseSession()
isDatabaseSession
in interface Session
public boolean isDistributedSession()
isDistributedSession
in interface Session
public boolean isInProfile()
isInProfile
in interface Session
public void setIsInProfile(boolean inProfile)
public void setIsInBroker(boolean isInBroker)
public boolean isFinalizersEnabled()
isFinalizersEnabled
in interface Session
public void registerFinalizer()
public boolean isHistoricalSession()
public void setIsFinalizersEnabled(boolean isFinalizersEnabled)
setIsFinalizersEnabled
in interface Session
public boolean isInTransaction()
public boolean isJPAQueriesProcessed()
public boolean isProtectedSession()
public boolean isRemoteSession()
isRemoteSession
in interface Session
public boolean isRemoteUnitOfWork()
isRemoteUnitOfWork
in interface Session
public boolean isServerSession()
isServerSession
in interface Session
public boolean isSessionBroker()
isSessionBroker
in interface Session
public boolean isSynchronized()
public boolean isUnitOfWork()
isUnitOfWork
in interface Session
public java.lang.Object getId(java.lang.Object domainObject) throws ValidationException
getId
in interface Session
ValidationException
@Deprecated public java.util.Vector keyFromObject(java.lang.Object domainObject) throws ValidationException
keyFromObject
in interface Session
ValidationException
getId(Object)
public java.lang.Object keyFromObject(java.lang.Object domainObject, ClassDescriptor descriptor) throws ValidationException
ValidationException
public void log(SessionLogEntry entry)
public void logMessage(java.lang.String message)
logMessage
in interface Session
public DatabaseQuery prepareDatabaseQuery(DatabaseQuery query)
The call back occurs soon before we clone the query for execution, meaning that if this method needs to clone the query then the caller will determine that it doesn't need to clone the query itself.
public java.util.Vector readAllObjects(java.lang.Class domainClass) throws DatabaseException
readAllObjects
in interface Session
DatabaseException
ReadAllQuery
,
readAllObjects(Class, Expression)
public java.util.Vector readAllObjects(java.lang.Class domainClass, java.lang.String sqlString) throws DatabaseException
DatabaseException
ReadAllQuery
public java.util.Vector readAllObjects(java.lang.Class referenceClass, Call aCall) throws DatabaseException
readAllObjects
in interface Session
DatabaseException
Call
public java.util.Vector readAllObjects(java.lang.Class domainClass, Expression expression) throws DatabaseException
readAllObjects
in interface Session
DatabaseException
ReadAllQuery
public java.lang.Object readObject(java.lang.Class domainClass) throws DatabaseException
readObject
in interface Session
DatabaseException
ReadObjectQuery
,
readAllObjects(Class, Expression)
public java.lang.Object readObject(java.lang.Class domainClass, java.lang.String sqlString) throws DatabaseException
DatabaseException
ReadObjectQuery
public java.lang.Object readObject(java.lang.Class domainClass, Call aCall) throws DatabaseException
readObject
in interface Session
DatabaseException
SQLCall
,
JPQLCall
public java.lang.Object readObject(java.lang.Class domainClass, Expression expression) throws DatabaseException
readObject
in interface Session
DatabaseException
ReadObjectQuery
public java.lang.Object readObject(java.lang.Object object) throws DatabaseException
readObject
in interface Session
DatabaseException
public java.lang.Object refreshAndLockObject(java.lang.Object object) throws DatabaseException
DatabaseException
#refreshAndLockObject(Object, lockMode)
public java.lang.Object refreshAndLockObject(java.lang.Object object, short lockMode) throws DatabaseException
Lock Modes: ObjectBuildingQuery.NO_LOCK, LOCK, LOCK_NOWAIT
DatabaseException
public java.lang.Object refreshObject(java.lang.Object object) throws DatabaseException
refreshObject
in interface Session
DatabaseException
public void release()
public void releaseUnitOfWork(UnitOfWorkImpl unitOfWork)
public void removeProperty(java.lang.String property)
removeProperty
in interface Session
public void removeQuery(java.lang.String queryName)
removeQuery
in interface Session
removeQuery(String, Vector)
public void removeQuery(java.lang.String queryName, java.util.Vector argumentTypes)
public void rollbackTransaction() throws DatabaseException, ConcurrencyException
DatabaseException
- if the database connection is lost or the rollback fails.ConcurrencyException
- if this session is not within a transaction.public void setAccessor(Accessor accessor)
public void setBroker(AbstractSession broker)
public void setCommitManager(CommitManager commitManager)
public void setEntityListenerInjectionManager(EntityListenerInjectionManager entityListenerInjectionManager)
public void setEventManager(SessionEventManager eventManager)
public void setExceptionHandler(ExceptionHandler exceptionHandler)
setExceptionHandler
in interface Session
public void setExternalTransactionController(ExternalTransactionController externalTransactionController)
setExternalTransactionController
in interface Session
CustomServerPlatform
public void setIntegrityChecker(IntegrityChecker integrityChecker)
setIntegrityChecker
in interface Session
public void setJPAQueriesProcessed(boolean jpaQueriesProcessed)
public void setLog(java.io.Writer log)
public void setLogin(DatabaseLogin login)
public void setLogin(Login login)
public void setDatasourceLogin(Login login)
public void setName(java.lang.String name)
public void setPessimisticLockTimeoutDefault(java.lang.Integer pessimisticLockTimeoutDefault)
public void setQueryTimeoutDefault(int queryTimeoutDefault)
setQueryTimeoutDefault
in interface Session
public void setProfiler(SessionProfiler profiler)
setProfiler
in interface Session
public void setProject(Project project)
public void setProperties(java.util.Map<java.lang.Object,java.lang.Object> propertiesMap)
propertiesMap
- public void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
setProperty
in interface Session
public void setQueries(java.util.Map<java.lang.String,java.util.List<DatabaseQuery>> queries)
public void setSessionLog(SessionLog sessionLog)
setSessionLog
in interface Session
logMessage(String)
public void setSynchronized(boolean synched)
public void setWasJTSTransactionInternallyStarted(boolean wasJTSTransactionInternallyStarted)
public boolean shouldLogMessages()
shouldLogMessages
in interface Session
public void startOperationProfile(java.lang.String operationName)
startOperationProfile
in interface CommandProcessor
public void startOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object unwrapObject(java.lang.Object proxy)
public java.lang.Object updateObject(java.lang.Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and
the object has been updated or deleted by another user since it was last read.UpdateObjectQuery
,
writeObject(Object)
public void validateCache()
validateCache
in interface Session
public void validateQuery(DatabaseQuery query)
public boolean verifyDelete(java.lang.Object domainObject)
public boolean wasJTSTransactionInternallyStarted()
public java.lang.Object wrapObject(java.lang.Object implementation)
public java.lang.Object writeObject(java.lang.Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
- if an error occurs on the database,
these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and
the object has been updated or deleted by another user since it was last read.WriteObjectQuery
,
insertObject(Object)
,
updateObject(Object)
public void writesCompleted()
public void processCommand(java.lang.Object command)
processCommand
in interface CommandProcessor
command
- Application formatted command to be processedpublic void processJPAQueries()
public CommandManager getCommandManager()
getCommandManager
in interface CommandProcessor
CommandManager
public void setCommandManager(CommandManager mgr)
setCommandManager
in interface CommandProcessor
mgr
- The CommandManager instance to control the remote command
service for this sessionCommandManager
public boolean shouldPropagateChanges()
setCommandManager(CommandManager)
public void setShouldPropagateChanges(boolean choice)
choice
- If true (and the CommandManager is set) then propagation will occursetCommandManager(CommandManager)
public boolean shouldLogMessages(int logLevel)
shouldLogMessages
in interface CommandProcessor
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUGpublic void logMessage(int logLevel, java.lang.String message)
logMessage
in interface CommandProcessor
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUGmessage
- The message String that is to be loggedpublic int getLogLevel(java.lang.String category)
Return the log level
getLogLevel
in interface Session
category
- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...
SessionLog
public int getLogLevel()
Return the log level
getLogLevel
in interface Session
SessionLog
public void setLogLevel(int level)
Set the log level
setLogLevel
in interface CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
setLogLevel
in interface Session
level
- the new log level
SessionLog
public boolean shouldDisplayData()
public boolean shouldLog(int Level, java.lang.String category)
Check if a message of the given level would actually be logged.
shouldLog
in interface Session
level
- the log request levelcategory
- the string representation of a EclipseLink category
SessionLog
public void log(int level, java.lang.String category, java.lang.String message)
Log a message with level and category that needs to be translated.
level
- the log request level value
message
- the string message
category
- the string representation of a EclipseLink category.
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object param)
Log a message with level, category and a parameter that needs to be translated.
level
- the log request level value
message
- the string message
category
- the string representation of a EclipseLink category.
param
- a parameter of the message
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
Log a message with level, category and two parameters that needs to be translated.
level
- the log request level value
message
- the string message
category
- the string representation of a EclipseLink category.
param1
- a parameter of the message
param2
- second parameter of the message
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
Log a message with level, category and three parameters that needs to be translated.
level
- the log request level value
message
- the string message
category
- the string representation of a EclipseLink category.
param1
- a parameter of the message
param2
- second parameter of the message
param3
- third parameter of the message
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object[] params)
Log a message with level, category and an array of parameters that needs to be translated.
level
- the log request level value
message
- the string message
category
- the string representation of a EclipseLink category.
params
- array of parameters to the message
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object[] params, Accessor accessor)
Log a message with level, category, parameters and accessor that needs to be translated.
level
- the log request level value
message
- the string message
params
- array of parameters to the message
accessor
- the connection that generated the log entry
category
- the string representation of a EclipseLink category.
public void log(int level, java.lang.String category, java.lang.String message, java.lang.Object[] params, Accessor accessor, boolean shouldTranslate)
Log a message with level, category, parameters and accessor. shouldTranslate determines if the message needs to be translated.
level
- the log request level value
message
- the string message
params
- array of parameters to the message
accessor
- the connection that generated the log entry
category
- the string representation of a EclipseLink category.
shouldTranslate
- true if the message needs to be translated.
@Deprecated public void log(int level, java.lang.String message, java.lang.Object[] params, Accessor accessor)
Log a message with level, parameters and accessor that needs to be translated.
level
- the log request level value
message
- the string message
params
- array of parameters to the message
accessor
- the connection that generated the log entry
@Deprecated public void log(int level, java.lang.String message, java.lang.Object[] params, Accessor accessor, boolean shouldTranslate)
Log a message with level, parameters and accessor. shouldTranslate determines if the message needs to be translated.
level
- the log request level value
message
- the string message
params
- array of parameters to the message
accessor
- the connection that generated the log entry
shouldTranslate
- true if the message needs to be translated.
public void logThrowable(int level, java.lang.String category, java.lang.Throwable throwable)
Log a throwable with level and category.
level
- the log request level value
category
- the string representation of a EclipseLink category.
throwable
- a Throwable
public void severe(java.lang.String message, java.lang.String category)
This method is called when a severe level message needs to be logged. The message will be translated
message
- the message key
public void warning(java.lang.String message, java.lang.String category)
This method is called when a warning level message needs to be logged. The message will be translated
message
- the message key
public void info(java.lang.String message, java.lang.String category)
This method is called when a info level message needs to be logged. The message will be translated
message
- the message key
public void config(java.lang.String message, java.lang.String category)
This method is called when a config level message needs to be logged. The message will be translated
message
- the message key
public void fine(java.lang.String message, java.lang.String category)
This method is called when a fine level message needs to be logged. The message will be translated
message
- the message key
public void finer(java.lang.String message, java.lang.String category)
This method is called when a finer level message needs to be logged. The message will be translated
message
- the message key
public void finest(java.lang.String message, java.lang.String category)
This method is called when a finest level message needs to be logged. The message will be translated
message
- the message key
public java.lang.Object handleSevere(java.lang.RuntimeException exception) throws java.lang.RuntimeException
handleSevere
in interface Session
java.lang.RuntimeException
public void releaseReadConnection(Accessor connection)
public void copyDescriptorsFromProject()
public void copyDescriptorNamedQueries(boolean allowSameQueryNameDiffArgsCopyToSession)
allowSameQueryNameDiffArgsCopyToSession
- if the value is true, it allow
multiple queries of the same name but different arguments to be copied to the session.public void postAcquireConnection(Accessor accessor)
public void preReleaseConnection(Accessor accessor)
public int priviledgedExecuteNonSelectingCall(Call call) throws DatabaseException
Example:
session.executeNonSelectingCall(new SQLCall("Delete from Employee"), true);
DatabaseException
priviledgedExecuteSelectingCall(Call)
public java.util.Vector priviledgedExecuteSelectingCall(Call call) throws DatabaseException
Example:
session.executeSelectingCall(new SQLCall("Select * from Employee");
DatabaseException
priviledgedExecuteNonSelectingCall(Call)
public boolean isExclusiveConnectionRequired()
public ReferenceMode getDefaultReferenceMode()
getDefaultReferenceMode
in interface Session
ReferenceMode
public void setDefaultReferenceMode(ReferenceMode defaultReferenceMode)
setDefaultReferenceMode
in interface Session
ReferenceMode
public void load(java.lang.Object objectOrCollection, AttributeGroup group)
objectOrCollection
- public void load(java.lang.Object objectOrCollection, AttributeGroup group, ClassDescriptor referenceDescriptor, boolean fromFetchGroup)
objectOrCollection
- public CacheKey retrieveCacheKey(java.lang.Object primaryKey, ClassDescriptor concreteDescriptor, JoinedAttributeManager joinManager, ObjectBuildingQuery query)
public PartitioningPolicy getPartitioningPolicy()
getPartitioningPolicy
in interface Session
public void setPartitioningPolicy(PartitioningPolicy partitioningPolicy)
setPartitioningPolicy
in interface Session
public MetadataRefreshListener getRefreshMetadataListener()
public void setRefreshMetadataListener(MetadataRefreshListener metadatalistener)
public boolean isConcurrent()
public void setIsConcurrent(boolean isConcurrent)
public void setShouldOptimizeResultSetAccess(boolean shouldOptimizeResultSetAccess)
public boolean shouldOptimizeResultSetAccess()
public void setTolerateInvalidJPQL(boolean b)
public boolean shouldTolerateInvalidJPQL()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference