public interface LocalEntityConnection extends EntityConnection
Domain domain = new Domain(); EntityConditions conditions = new EntityConditions(domain); Database database = new H2Database("pathToDb"); User user = new User("scott", "tiger".toCharArray()); EntityConnection connection = LocalEntityConnections.createConnection(domain, database, user); List<Entity> entities = connection.selectMany(conditions.selectCondition(Domain.ENTITY_ID)); connection.disconnect();
Modifier and Type | Field and Description |
---|---|
static PropertyValue<java.lang.Integer> |
CONNECTION_LOG_SIZE
Specifies the size of the (circular) log that is kept in memory for each connection
Value type: Integer Default value: 40 |
static int |
DEFAULT_CONNECTION_LOG_SIZE |
static PropertyValue<java.lang.Boolean> |
LIMIT_FOREIGN_KEY_FETCH_DEPTH
Specifies whether the foreign key value graph should be fully populated instead of
being limited by the foreign key fetch depth setting.
Value type: Boolean Default value: true |
static PropertyValue<java.lang.Boolean> |
USE_OPTIMISTIC_LOCKING
Specifies whether optimistic locking should be performed, that is, if entities should
be selected for update and checked for modification before being updated
Value type: Boolean Default value: true |
Modifier and Type | Method and Description |
---|---|
DatabaseConnection |
getDatabaseConnection() |
MethodLogger |
getMethodLogger() |
boolean |
isLimitForeignKeyFetchDepth() |
boolean |
isOptimisticLocking() |
ResultIterator<Entity> |
iterator(EntitySelectCondition condition)
Returns a result set iterator based on the given query condition, this iterator closes all underlying
resources in case of an exception and when it finishes iterating.
|
void |
setLimitForeignKeyFetchDepth(boolean limitForeignKeyFetchDepth) |
void |
setMethodLogger(MethodLogger methodLogger) |
void |
setOptimisticLocking(boolean optimisticLocking) |
beginTransaction, commitTransaction, delete, delete, disconnect, executeFunction, executeProcedure, fillReport, getDomain, getUser, insert, isConnected, isTransactionOpen, readBlob, rollbackTransaction, selectDependencies, selectMany, selectMany, selectMany, selectRowCount, selectSingle, selectSingle, selectSingle, selectValues, update, writeBlob
static final int DEFAULT_CONNECTION_LOG_SIZE
static final PropertyValue<java.lang.Integer> CONNECTION_LOG_SIZE
static final PropertyValue<java.lang.Boolean> USE_OPTIMISTIC_LOCKING
static final PropertyValue<java.lang.Boolean> LIMIT_FOREIGN_KEY_FETCH_DEPTH
void setMethodLogger(MethodLogger methodLogger)
methodLogger
- the MethodLogger to useMethodLogger getMethodLogger()
DatabaseConnection getDatabaseConnection()
ResultIterator<Entity> iterator(EntitySelectCondition condition) throws DatabaseException
ResultIterator.close()
is required if the iterator has not been exhausted and is always recommended.condition
- the query conditionDatabaseException
- in case of an exceptionboolean isOptimisticLocking()
void setOptimisticLocking(boolean optimisticLocking)
optimisticLocking
- true if optimistic locking should be enabledboolean isLimitForeignKeyFetchDepth()
void setLimitForeignKeyFetchDepth(boolean limitForeignKeyFetchDepth)
limitForeignKeyFetchDepth
- false to override the fetch depth limit provided by conditionEntitySelectCondition.setForeignKeyFetchDepthLimit(int)