public interface PersistenceHandlerI
A `PersistenceHandlerI` acts as an intermediary between the application and the underlying persistence mechanism (e.g., a database). It provides methods to control transactions, create, retrieve, update, and delete objects, and manage the persistence context.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
$0 |
static int |
DB_LOCKED |
static int |
EXCLUSIVE |
static int |
READ_ONLY |
static int |
SHARED |
| Modifier and Type | Method and Description |
|---|---|
BO |
assureClassStability(BO bo,
int mode,
java.util.Set<java.lang.Long> keepLocked) |
void |
begin()
Convenience method to initiate a transaction using the default lock timeout.
|
void |
begin(int lockTimeout)
Initiates a new transaction within the current persistence context.
|
void |
cancelCreate(BO bo) |
void |
cancelPurge(BO bo)
Cancels a previously scheduled purge operation for a BO.
|
void |
commit()
Actually creates new
BOs and persists changes to the database
storage; but is also called when data was just queried...? |
void |
create(BO bo) |
void |
dbLock(BO bo) |
boolean |
exists(java.lang.Class<? extends BOI> classtip,
java.lang.Long id) |
void |
finish() |
java.lang.RuntimeException |
getFinishedBy() |
BOLoaderI |
getInjectBOLoader() |
java.sql.Connection |
getJdbcConnection() |
SchemaI |
getSchema() |
boolean |
isActive()
Returns true if begin() was already called, false otherwise or if already finish()ed.
|
boolean |
isAutoFinish() |
boolean |
isFinished()
Returns true, if finish() was already called.
|
boolean |
isForSaving()
Returns true if the TransactionContext will remember all objects that were loaded with a readonly
lock.
|
boolean |
isLoadedReadOnly(java.lang.Long id)
Returns true if the BO with the passed id is currently loaded in read-only mode.
|
boolean |
isPersistent(BO bo) |
de.ipcon.db.core.QueryResultsI |
iterateNativeQuery(java.lang.String s) |
de.ipcon.db.core.QueryResultsI |
iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms) |
de.ipcon.db.core.QueryResultsI |
iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms,
short mode) |
de.ipcon.db.core.QueryResultsI |
iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms,
short mode,
java.lang.String[] prefetchPaths) |
de.ipcon.db.core.QueryResultsI |
iterateQuery(java.lang.String s) |
de.ipcon.db.core.QueryResultsI |
iterateQuery(java.lang.String s,
java.lang.Object[] parms) |
de.ipcon.db.core.QueryResultsI |
iterateQuery(java.lang.String s,
java.lang.Object[] parms,
short mode) |
de.ipcon.db.core.QueryResultsI |
iterateRelationBOs(java.lang.Class<? extends BOI> classtip,
java.lang.Long id,
java.lang.String attName) |
de.ipcon.db.core.QueryResultsI |
iterateRelationBOs(java.lang.Class<? extends BOI> classtip,
java.lang.Long id,
java.lang.String attName,
short mode) |
java.util.List |
listQuery(java.lang.String s) |
java.util.List |
listQuery(java.lang.String s,
java.lang.Object[] parms) |
java.util.List |
listQuery(java.lang.String s,
java.lang.Object[] parms,
short mode) |
java.util.List |
listRelationBOs(java.lang.Class<? extends BOI> classtip,
java.lang.Long id,
java.lang.String attName) |
java.util.List |
listRelationBOs(java.lang.Class<? extends BOI> classtip,
java.lang.Long id,
java.lang.String attName,
short mode) |
BO |
load(java.lang.Class<? extends BOI> classtip,
java.lang.Long id,
int mode,
java.util.Set<java.lang.Long> keepLocked,
BO into,
boolean syncModeCheck) |
BO |
loadReadOnly(java.lang.Class<? extends BOI> classtip,
java.lang.Long id) |
void |
purge(BO bo)
Marks a BO for purging from persistent storage upon transaction commit.
|
void |
rollback() |
void |
setAutoFinish(boolean b) |
void |
setIgnoreMultipleBegin()
Configures the handler to permit multiple calls to
begin() without error. |
void |
setInjectBOLoader(BOLoaderI bol) |
static final java.lang.String $0
static final int READ_ONLY
static final int SHARED
static final int EXCLUSIVE
static final int DB_LOCKED
void begin(int lockTimeout)
Transaction Reuse:
If a transaction is already active, behavior depends on the setIgnoreMultipleBegin() setting:
Lifecycle & Error Handling:
IllegalStateException if the handler is already marked as "finished".LockNotGrantedException.lockTimeout - The time (in seconds) to wait for a database lock if a resource is contended.
-1.java.lang.IllegalStateException - If the handler has already been finished/closed.LockNotGrantedException - If a lock cannot be acquired within the timeout period.PersistenceException - If a general error occurs during transaction initialization.void begin()
Equivalent to calling begin(-1). See begin(int) for full details
on transaction reuse and error handling.
LockNotGrantedException - If a lock cannot be acquired using the default system timeout.void dbLock(BO bo)
void create(BO bo)
void cancelCreate(BO bo)
void purge(BO bo)
This method schedules the specified BO for permanent deletion from the database.
bo - The BO to be purged.java.lang.IllegalArgumentException - if any of the following conditions occur:
void cancelPurge(BO bo)
This method removes the specified BO from the internal collection of objects marked for deletion upon transaction commit. It is essential to ensure that the provided BO was indeed scheduled for purging before calling this method.
bo - The BO whose purge operation should be cancelled.java.lang.IllegalArgumentException - if any of the following conditions occur:
boolean exists(java.lang.Class<? extends BOI> classtip, java.lang.Long id)
boolean isLoadedReadOnly(java.lang.Long id)
BO load(java.lang.Class<? extends BOI> classtip, java.lang.Long id, int mode, java.util.Set<java.lang.Long> keepLocked, BO into, boolean syncModeCheck)
boolean isPersistent(BO bo)
boolean isActive()
boolean isForSaving()
void rollback()
void commit()
BOs and persists changes to the database
storage; but is also called when data was just queried...?void finish()
boolean isFinished()
java.lang.RuntimeException getFinishedBy()
void setAutoFinish(boolean b)
boolean isAutoFinish()
void setIgnoreMultipleBegin()
begin() without error.
When this flag is set, calling begin() while a transaction is already active
will effectively do nothing (the existing transaction is reused). This is useful
for code paths where the transaction boundaries are not strictly known or may overlap.
Note: This setting usually persists only for the lifetime of this handler instance.
de.ipcon.db.core.QueryResultsI iterateQuery(java.lang.String s,
java.lang.Object[] parms,
short mode)
de.ipcon.db.core.QueryResultsI iterateQuery(java.lang.String s,
java.lang.Object[] parms)
de.ipcon.db.core.QueryResultsI iterateQuery(java.lang.String s)
java.util.List listQuery(java.lang.String s,
java.lang.Object[] parms,
short mode)
java.util.List listQuery(java.lang.String s,
java.lang.Object[] parms)
java.util.List listQuery(java.lang.String s)
de.ipcon.db.core.QueryResultsI iterateRelationBOs(java.lang.Class<? extends BOI> classtip, java.lang.Long id, java.lang.String attName, short mode)
de.ipcon.db.core.QueryResultsI iterateRelationBOs(java.lang.Class<? extends BOI> classtip, java.lang.Long id, java.lang.String attName)
java.util.List listRelationBOs(java.lang.Class<? extends BOI> classtip, java.lang.Long id, java.lang.String attName, short mode)
java.util.List listRelationBOs(java.lang.Class<? extends BOI> classtip, java.lang.Long id, java.lang.String attName)
java.sql.Connection getJdbcConnection()
BO assureClassStability(BO bo, int mode, java.util.Set<java.lang.Long> keepLocked)
SchemaI getSchema()
BOLoaderI getInjectBOLoader()
void setInjectBOLoader(BOLoaderI bol)
de.ipcon.db.core.QueryResultsI iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms,
short mode,
java.lang.String[] prefetchPaths)
de.ipcon.db.core.QueryResultsI iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms,
short mode)
de.ipcon.db.core.QueryResultsI iterateNativeQuery(java.lang.String s,
java.lang.Object[] parms)
de.ipcon.db.core.QueryResultsI iterateNativeQuery(java.lang.String s)
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.