public class PersistenceSession extends SSessionJdbc implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
protected class |
PersistenceSession.PersistenceSessionDBInterface
This is a special wrapper that uses our Connection for operations.
|
Constructor and Description |
---|
PersistenceSession() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Main method for closing a session.
|
DBInterface |
getDBInterface() |
static PersistenceSession |
getThreadLocalSession() |
void |
initialize(javax.sql.DataSource source,
java.lang.String connectionName,
DBInterface dbi,
SDriver driver) |
<T extends PersistentRecord> |
queryOne(SQuery<T> query)
Returns the first result from the query, or null if there were no results
|
protected void |
setDBInterface(DBInterface dbInterface) |
associateWithThread, attachToThread, begin, begin, commit, commitAndDetachDataSet, create, createWithGeneratedKey, detachFromThread, dirtyPurge, dissassociateFromThread, find, find, findOrCreate, findOrCreate, findOrCreate, findOrCreate, findOrCreate, flush, flush, flushAndPurge, flushAndPurge, getDataSet, getDataSource, getDriver, getJdbcConnection, getLogger, getStatistics, hasBegun, innerOpen, mustFind, mustFind, open, open, query, queryNoFlush, queryOnlyRecord, rawQueryMap, rawQueryMaps, rawQueryOneMap, rawQuerySingle, rawUpdateDB, rawUpdateDBNoFlush, rollback, setTransactionIsolation, toString
public static PersistenceSession getThreadLocalSession()
public void initialize(javax.sql.DataSource source, java.lang.String connectionName, DBInterface dbi, SDriver driver)
public DBInterface getDBInterface()
protected void setDBInterface(DBInterface dbInterface)
public <T extends PersistentRecord> T queryOne(SQuery<T> query)
public void close()
SSessionJdbc
Closes the JDBC connection and then calls detachWithoutClosing
to detach the SimpleORM connection
from the current thread. Should usually be put in a finally clause. No error if already detached or closed so
safe in finally clauses.
close
in interface java.lang.AutoCloseable
close
in class SSessionJdbc