Package cz.cvut.kbss.jopa.sessions
Class ServerSession
java.lang.Object
cz.cvut.kbss.jopa.sessions.AbstractSession
cz.cvut.kbss.jopa.sessions.ServerSession
- All Implemented Interfaces:
ConfigurationHolder
,MetamodelProvider
,Wrapper
The ServerSession is the primary interface for accessing the ontology.
It manages an accessor object, which performs the queries.
-
Field Summary
Fields inherited from class cz.cvut.kbss.jopa.sessions.AbstractSession
configuration
-
Constructor Summary
ConstructorsConstructorDescriptionServerSession
(OntologyStorageProperties storageProperties, Configuration configuration, MetamodelImpl metamodel) -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionWrapper
Acquires connection to the underlying ontology storage.acquireUnitOfWork
(Configuration configuration) Acquires aUnitOfWork
instance to perform transactional operations.void
close()
Close the server session and all connections to the underlying data source.Gets aCriteriaBuilder
instance for building Criteria API queries.Get the current live object cache.Gets the metamodelboolean
isEntityType
(Class<?> cls) Checks whether the specified class is an entity type.void
void
<T> T
Unwraps implementation of the specified class.Methods inherited from class cz.cvut.kbss.jopa.sessions.AbstractSession
getConfiguration
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.cvut.kbss.jopa.sessions.MetamodelProvider
getNamedQueryManager, getResultSetMappingManager
-
Constructor Details
-
ServerSession
public ServerSession(OntologyStorageProperties storageProperties, Configuration configuration, MetamodelImpl metamodel)
-
-
Method Details
-
acquireUnitOfWork
Acquires aUnitOfWork
instance to perform transactional operations.- Returns:
- UnitOfWork instance
-
acquireConnection
Description copied from class:AbstractSession
Acquires connection to the underlying ontology storage.- Specified by:
acquireConnection
in classAbstractSession
- Returns:
- Connection
-
getLiveObjectCache
Description copied from class:AbstractSession
Get the current live object cache.This manager represents the second level cache.
- Specified by:
getLiveObjectCache
in classAbstractSession
- Returns:
- Second level cache manager
-
transactionStarted
-
transactionFinished
-
close
public void close()Close the server session and all connections to the underlying data source. -
getMetamodel
Description copied from interface:MetamodelProvider
Gets the metamodel- Specified by:
getMetamodel
in interfaceMetamodelProvider
- Returns:
- Metamodel
-
isEntityType
Description copied from interface:MetamodelProvider
Checks whether the specified class is an entity type.- Specified by:
isEntityType
in interfaceMetamodelProvider
- Parameters:
cls
- The class to check- Returns:
- Whether type is managed
-
getCriteriaBuilder
Description copied from class:AbstractSession
Gets aCriteriaBuilder
instance for building Criteria API queries.- Specified by:
getCriteriaBuilder
in classAbstractSession
- Returns:
- Criteria query builder
-
unwrap
Description copied from interface:Wrapper
Unwraps implementation of the specified class.
-