Package | Description |
---|---|
com.j256.ormlite.dao |
Database Access Object classes.
|
com.j256.ormlite.misc |
Miscellaneous classes.
|
com.j256.ormlite.stmt |
SQL statement generation and processing.
|
com.j256.ormlite.stmt.mapped |
Compiled SQL query statements.
|
com.j256.ormlite.support |
Database support classes.
|
Modifier and Type | Method and Description |
---|---|
DatabaseConnection |
BaseDaoImpl.startThreadConnection() |
DatabaseConnection |
Dao.startThreadConnection()
WARNING: This method is for advanced users only.
|
DatabaseConnection |
RuntimeExceptionDao.startThreadConnection() |
Modifier and Type | Method and Description |
---|---|
void |
BaseDaoImpl.commit(DatabaseConnection connection) |
void |
Dao.commit(DatabaseConnection connection)
If you have previously set auto-commit to false using
Dao.setAutoCommit(DatabaseConnection, boolean) then
this will commit all changes to the database made from that point up to now on the connection returned by the
Dao.startThreadConnection() . |
void |
RuntimeExceptionDao.commit(DatabaseConnection connection) |
void |
BaseDaoImpl.endThreadConnection(DatabaseConnection connection) |
void |
Dao.endThreadConnection(DatabaseConnection connection)
WARNING: This method is for advanced users only.
|
void |
RuntimeExceptionDao.endThreadConnection(DatabaseConnection connection) |
boolean |
BaseDaoImpl.isAutoCommit(DatabaseConnection connection) |
boolean |
Dao.isAutoCommit(DatabaseConnection connection)
Return true if the database connection returned by the
Dao.startThreadConnection() is in auto-commit mode
otherwise false. |
boolean |
RuntimeExceptionDao.isAutoCommit(DatabaseConnection connection) |
void |
BaseDaoImpl.rollBack(DatabaseConnection connection) |
void |
Dao.rollBack(DatabaseConnection connection)
If you have previously set auto-commit to false using
Dao.setAutoCommit(DatabaseConnection, boolean) then
this will roll-back and flush all changes to the database made from that point up to now on the connection
returned by the Dao.startThreadConnection() . |
void |
RuntimeExceptionDao.rollBack(DatabaseConnection connection) |
void |
BaseDaoImpl.setAutoCommit(DatabaseConnection connection,
boolean autoCommit) |
void |
Dao.setAutoCommit(DatabaseConnection connection,
boolean autoCommit)
Set auto-commit mode to be true or false on the connection returned by the
Dao.startThreadConnection() . |
void |
RuntimeExceptionDao.setAutoCommit(DatabaseConnection connection,
boolean autoCommit) |
Modifier and Type | Field and Description |
---|---|
protected DatabaseConnection |
WrappedDatabaseConnection.connection |
protected DatabaseConnection |
WrappedDatabaseConnection.connectionProxy |
Modifier and Type | Method and Description |
---|---|
DatabaseConnection |
WrappedDatabaseConnection.getDatabaseConnection() |
DatabaseConnection |
WrappedDatabaseConnection.getDatabaseConnectionProxy() |
DatabaseConnection |
WrappedConnectionSource.getReadOnlyConnection(String tableName) |
DatabaseConnection |
WrappedConnectionSource.getReadWriteConnection(String tableName) |
DatabaseConnection |
WrappedConnectionSource.getSpecialConnection(String tableName) |
Modifier and Type | Method and Description |
---|---|
static <T> T |
TransactionManager.callInTransaction(DatabaseConnection connection,
boolean saved,
DatabaseType databaseType,
Callable<T> callable)
Same as
TransactionManager.callInTransaction(Callable) except as a static method on a connection with database-type. |
static <T> T |
TransactionManager.callInTransaction(DatabaseConnection connection,
DatabaseType databaseType,
Callable<T> callable)
Same as
TransactionManager.callInTransaction(Callable) except as a static method on a connection with database-type. |
void |
WrappedConnectionSource.clearSpecialConnection(DatabaseConnection connection) |
void |
WrappedConnectionSource.releaseConnection(DatabaseConnection proxy) |
boolean |
WrappedConnectionSource.saveSpecialConnection(DatabaseConnection connection) |
Constructor and Description |
---|
WrappedDatabaseConnection(DatabaseConnection connection) |
Modifier and Type | Method and Description |
---|---|
CompiledStatement |
PreparedStmt.compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type)
Create and return the associated compiled statement.
|
CompiledStatement |
PreparedStmt.compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type,
int resultFlags)
Like compile(DatabaseConnection, StatementType) but allows to specify the result flags.
|
int |
StatementExecutor.create(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Create a new entry in the database from an object.
|
int |
StatementExecutor.delete(DatabaseConnection databaseConnection,
PreparedDelete<T> preparedDelete)
Delete rows that match the prepared statement.
|
int |
StatementExecutor.delete(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Delete an object from the database.
|
int |
StatementExecutor.deleteById(DatabaseConnection databaseConnection,
ID id,
ObjectCache objectCache)
Delete an object from the database by id.
|
int |
StatementExecutor.deleteIds(DatabaseConnection databaseConnection,
Collection<ID> ids,
ObjectCache objectCache)
Delete a collection of objects from the database.
|
int |
StatementExecutor.deleteObjects(DatabaseConnection databaseConnection,
Collection<T> datas,
ObjectCache objectCache)
Delete a collection of objects from the database.
|
int |
StatementExecutor.executeRaw(DatabaseConnection connection,
String statement,
String[] arguments)
Return true if it worked else false.
|
int |
StatementExecutor.executeRawNoArgs(DatabaseConnection connection,
String statement)
Return true if it worked else false.
|
boolean |
StatementExecutor.ifExists(DatabaseConnection connection,
ID id) |
long |
StatementExecutor.queryForCountStar(DatabaseConnection databaseConnection)
Return a long value which is the number of rows in the table.
|
T |
StatementExecutor.queryForFirst(DatabaseConnection databaseConnection,
PreparedStmt<T> preparedStmt,
ObjectCache objectCache)
Return the first object that matches the
PreparedStmt or null if none. |
T |
StatementExecutor.queryForId(DatabaseConnection databaseConnection,
ID id,
ObjectCache objectCache)
Return the object associated with the id or null if none.
|
long |
StatementExecutor.queryForLong(DatabaseConnection databaseConnection,
PreparedStmt<T> preparedStmt)
Return a long value from a prepared query.
|
long |
StatementExecutor.queryForLong(DatabaseConnection databaseConnection,
String query,
String[] arguments)
Return a long from a raw query with String[] arguments.
|
int |
StatementExecutor.refresh(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Does a query for the object's Id and copies in each of the field values from the database to refresh the data
parameter.
|
int |
StatementExecutor.update(DatabaseConnection databaseConnection,
PreparedUpdate<T> preparedUpdate)
Update rows in the database.
|
int |
StatementExecutor.update(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Update an object in the database.
|
int |
StatementExecutor.updateId(DatabaseConnection databaseConnection,
T data,
ID newId,
ObjectCache objectCache)
Update an object in the database to change its id to the newId parameter.
|
int |
StatementExecutor.updateRaw(DatabaseConnection connection,
String statement,
String[] arguments)
Return the number of rows affected.
|
Constructor and Description |
---|
RawResultsImpl(ConnectionSource connectionSource,
DatabaseConnection connection,
Class<?> clazz,
CompiledStatement compiledStmt,
GenericRowMapper<T> rowMapper,
ObjectCache objectCache) |
SelectIterator(Class<?> dataClass,
Dao<T,ID> classDao,
GenericRowMapper<T> rowMapper,
ConnectionSource connectionSource,
DatabaseConnection connection,
CompiledStatement compiledStmt,
ObjectCache objectCache)
If the statement parameter is null then this won't log information
|
Modifier and Type | Method and Description |
---|---|
CompiledStatement |
MappedPreparedStmt.compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type) |
CompiledStatement |
MappedPreparedStmt.compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type,
int resultFlags) |
int |
MappedDelete.delete(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Delete the object from the database.
|
int |
MappedDelete.deleteById(DatabaseConnection databaseConnection,
ID id,
ObjectCache objectCache)
Delete the object from the database.
|
static <T,ID> int |
MappedDeleteCollection.deleteIds(Dao<T,ID> dao,
TableInfo<T,ID> tableInfo,
DatabaseConnection databaseConnection,
Collection<ID> ids,
ObjectCache objectCache)
Delete all of the objects in the collection.
|
static <T,ID> int |
MappedDeleteCollection.deleteObjects(Dao<T,ID> dao,
TableInfo<T,ID> tableInfo,
DatabaseConnection databaseConnection,
Collection<T> datas,
ObjectCache objectCache)
Delete all of the objects in the collection.
|
T |
MappedQueryForFieldEq.execute(DatabaseConnection databaseConnection,
ID id,
ObjectCache objectCache)
Query for an object in the database which matches the id argument.
|
int |
MappedUpdateId.execute(DatabaseConnection databaseConnection,
T data,
ID newId,
ObjectCache objectCache)
Update the id field of the object in the database.
|
int |
MappedRefresh.executeRefresh(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Execute our refresh query statement and then update all of the fields in data with the fields from the result.
|
int |
MappedCreate.insert(DatabaseType databaseType,
DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Create an object in the database.
|
int |
MappedUpdate.update(DatabaseConnection databaseConnection,
T data,
ObjectCache objectCache)
Update the object in the database.
|
Modifier and Type | Class and Description |
---|---|
class |
DatabaseConnectionProxy
Database connection proxy so you can intercept database operations either for debugging, replication, logging, or
other purposes.
|
Modifier and Type | Method and Description |
---|---|
DatabaseConnection |
ReflectionDatabaseConnectionProxyFactory.createProxy(DatabaseConnection realConnection) |
DatabaseConnection |
DatabaseConnectionProxyFactory.createProxy(DatabaseConnection realConnection)
Create a proxy database connection that may extend
DatabaseConnectionProxy . |
DatabaseConnection |
ConnectionSource.getReadOnlyConnection(String tableName)
Return a database connection suitable for read-only operations.
|
DatabaseConnection |
ConnectionSource.getReadWriteConnection(String tableName)
Return a database connection suitable for read or write operations.
|
protected DatabaseConnection |
BaseConnectionSource.getSavedConnection()
Returns the connection that has been saved or null if none.
|
DatabaseConnection |
ConnectionSource.getSpecialConnection(String tableName)
Return the currently saved connection or null if none.
|
DatabaseConnection |
BaseConnectionSource.getSpecialConnection(String tableName) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
BaseConnectionSource.clearSpecial(DatabaseConnection connection,
Logger logger)
Clear the connection that was previously saved.
|
void |
ConnectionSource.clearSpecialConnection(DatabaseConnection connection)
Clear the saved connection.
|
DatabaseConnection |
ReflectionDatabaseConnectionProxyFactory.createProxy(DatabaseConnection realConnection) |
DatabaseConnection |
DatabaseConnectionProxyFactory.createProxy(DatabaseConnection realConnection)
Create a proxy database connection that may extend
DatabaseConnectionProxy . |
protected boolean |
BaseConnectionSource.isSavedConnection(DatabaseConnection connection)
Return true if the connection being released is the one that has been saved.
|
protected boolean |
BaseConnectionSource.isSingleConnection(DatabaseConnection conn1,
DatabaseConnection conn2)
Return true if the two connections seem to one one connection under the covers.
|
void |
ConnectionSource.releaseConnection(DatabaseConnection connection)
Release a database connection previously returned by
ConnectionSource.getReadOnlyConnection(String) or
ConnectionSource.getReadWriteConnection(String) . |
protected boolean |
BaseConnectionSource.saveSpecial(DatabaseConnection connection)
Save this connection as our special connection to be returned by the
BaseConnectionSource.getSavedConnection() method. |
boolean |
ConnectionSource.saveSpecialConnection(DatabaseConnection connection)
Save this connection and return it for all calls to
ConnectionSource.getReadOnlyConnection(String) and
ConnectionSource.getReadWriteConnection(String) unless the ConnectionSource.clearSpecialConnection(DatabaseConnection) method is
called, all This is used by the transaction mechanism since since all operations within a transaction must
operate on the same connection. |
Constructor and Description |
---|
DatabaseConnectionProxy(DatabaseConnection proxy) |
Constructor and Description |
---|
ReflectionDatabaseConnectionProxyFactory(Class<? extends DatabaseConnection> proxyClass)
Takes a proxy-class that will be used to instantiate an instance in
ReflectionDatabaseConnectionProxyFactory.createProxy(DatabaseConnection) . |
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.