public abstract class DataObjectReadOnlyWithCache extends DataObject
changeLogger, columnNames, columnType, htColumnType, INSERTMODE, maxFieldSize, original, UPDATEMODE
Constructor and Description |
---|
DataObjectReadOnlyWithCache(DataObjectConstructionDetails dataObjectConstructionDetails,
int maxColumns) |
DataObjectReadOnlyWithCache(DataObjectConstructionDetails dataObjectConstructionDetails,
int maxColumns,
int initialSize) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
cacheLoad(Identifier identifier) |
protected void |
cachePut(Identifier identifier) |
void |
free()
Releases external resources.
|
protected abstract java.lang.String |
getReducedColumnSet()
Return the reduced column set to optimize database access or null if all fields are needed.
|
protected void |
init()
Called by constructor and by data change listener to initialize or reset cache.
|
boolean |
load(Identifier identifier)
Loads a row as specified by the primary key.
|
boolean |
save()
Saves the current row.
|
boolean |
select(java.lang.String fieldSelection,
java.lang.String whereCondition)
Invokes a database query for following record requests via
nextRow() . |
addDataChangeListener, addDataSelectionListener, alertBadUniqueKey, allocateNewIdentifier, checkRecoverConnection, closeIfExists, closePreparedStatementsForWhereCondition, closeQuery, commitIfNotAutoCommit, contains, contains, contains, contains, contains, contains, count, count, count, count, count, count, countThrowException, delete, delete, deleteFreeConditioned, deleteFreeConditioned, deleteFreeConditionedAndCount, discardStatements, ensureMetaDataIsAvailableForAllColumns, finalize, fireDataChanged, getBoolean, getBoolean, getBytes, getColumnCount, getColumnLabel, getColumnLength, getColumnName, getColumnName, getColumnScale, getColumnType, getColumnType, getColumnType, getColumnType, getConnection, getDate, getDate, getDate, getDateFormattedWithShortYear, getDeletionHindrance, getDescription, getDescription, getDouble, getDouble, getEntityId, getFailedQueryExpression, getFloat, getGlobalWhereCondition, getGlobalWhereCondition, getIdentifier, getIdentifyTemplate, getIdentifyValueInt, getIdentifyWhereCondition, getIdManager, getInt, getInt, getIntAsStringZeroSuppressed, getKeyExtendedFieldSelection, getLastException, getLoadException, getLong, getmaxRow, getMode, getNbrOfFittingItems, getNbrOfFittingItems, getNbrOfFittingItems, getNbrOfFittingItems, getNbrOfFittingItems, getNbrOfFittingItems, getObject, getOriginalOf, getQueryException, getRecordingDate, getRecordingUser, getRowCount, getSqlCompareString, getSqlCompareString, getText, getText, getTextNoMatterWhatTypeOfColumn, getTime, getTimestamp, getUniqueKeyName, getWorkedOnBoolean, getWorkedOnDate, getWorkedOnDouble, getWorkedOnInt, getWorkedOnOf, getWorkedOnText, getWorkedOnText, getWorkedOnTime, getWorkedOnTimestamp, insert, isAvailable, isAvailable, isAvailable, isColumnContained, isColumnToUseForGlobalSearch, isDeletionAllowed, isKnownAsBoolean, isMemo, isModified, isModifiedColumn, isQueryFindingRecords, isQueryFindingRecords, load, load, load, load, load, load, loadColumns, loadFirst, logDebug, logError, logError, logError, logInfo, newRow, newRowWithNextIdentifierAllocation, nextColumn, nextRow, openQuery, openQueryThrowException, register, removeDataChangeListener, removeDataSelectionListener, resetColumnPointer, rollbackIfNotAutoCommit, save, save, searchGlobal, searchGlobal, select, select, select, select, select, select, select, select, select, select, select, select, select, selectForStreaming, setBoolean, setChangeLog, setChangeLogger, setColumnNameOfRecordingDate, setConnection, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setIdentifier, setIdentityValue, setIdentityValue, setIdentityValue, setIdInclOriginal, setIdManager, setInt, setInt, setLong, setNoLogging, setObject, setReadBigDecimalAsInt, setRecordingUser, setRecordingUser, setSilentUpdate, setText, setText, setTime, setTimestamp, sqlExceptionConsequences, sqlSecure, unifyColumnName, unifyColumnNameForHashMapKey, unifyTableName, update, updateIdentifier, updateOrInsert, updateOrInsert
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttributes, getForeignKeys, getIndices, getTableName
public DataObjectReadOnlyWithCache(DataObjectConstructionDetails dataObjectConstructionDetails, int maxColumns)
public DataObjectReadOnlyWithCache(DataObjectConstructionDetails dataObjectConstructionDetails, int maxColumns, int initialSize)
protected void init()
public boolean select(java.lang.String fieldSelection, java.lang.String whereCondition)
DataObject
nextRow()
.
Always invoke DataObject.closeQuery()
to release table handle in the end.
public boolean isDeletionAllowed(Identifier identifier) { if (doMedien == null) doMedien = new DoMedien(); doMedien.select("MedienNi, KatalogNi", "KatalogNi = " + identifier.getIntIdentifier()); while (doMedien.nextRow()) { if (!doMedien.isDeletionAllowed(doMedien.getIdentifier())) { doMedien.closeQuery(); return false; } } doMedien.closeQuery(); return true; }
select
in class DataObject
fieldSelection
- a sequence of field names to be accessed, separated
by commawhereCondition
- the condition to reduce the result setDataObject.openQuery(java.lang.String)
,
DataObject.closeQuery()
public boolean load(Identifier identifier)
DataObject
load
in class DataObject
identifier
- the primary key value of the row to loadprotected abstract java.lang.String getReducedColumnSet()
protected boolean cacheLoad(Identifier identifier)
protected void cachePut(Identifier identifier)
public boolean save()
DataObject
save
in class DataObject
public void free()
Exemptible
free
in interface Exemptible
free
in class DataObject
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de