public class DBManLocalBOLoader extends java.lang.Object implements BackendQueryAnsweringBOLoaderI, BackendBOLoaderWithPersistenceHandlerI
This class extends the functionality of BOLoaderI to provide specific features for processing backend queries. It implements both BackendQueryAnsweringBOLoaderI and BackendBOLoaderWithPersistenceHandlerI, allowing it to be aware of its backend query context and manage backend-local persistence operations efficiently.
This loader is typically used within the server-side environment to handle queries originating from backend processes or services. It provides optimized handling for such queries, including the ability to serialize non-persistent attributes and manage backend-local database transactions effectively.
BOQueryLoaderI.InternalHelperrootPaneToLockOnConnectionInterrupt| Constructor and Description |
|---|
DBManLocalBOLoader(DBManLocalI _dbman) |
DBManLocalBOLoader(DBManLocalI _dbman,
BackendSessionI _session) |
DBManLocalBOLoader(DBManLocalI _dbman,
BackendSessionI _session,
boolean _intendedForSaving) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearPersistenceHandler() |
void |
drain()
If this BOLoader has a cache, we request it to empty it.
|
void |
execute(BatchedBackendRequestI[] srs) |
boolean |
exists(java.lang.Long id)
wrapper for exists(id, null).
|
boolean |
exists(java.lang.Long id,
java.lang.Class<? extends BOI> classtip)
Returns true if a BO with the given id exists.
|
BO |
frapFromCache(BO bo)
Put a BO instance to further use in this BOLoader, cloning it in case it's unknown,
giving back a cached instance in case it's cached,
in any way returning an instance without making further reloads (which would make
the effort of caching it useless).
|
byte[] |
getBLOB(java.lang.Long id)
get the BLOB belonging to BO[id].
|
long |
getBLOB(java.lang.Long id,
java.io.DataOutput os)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
long |
getBLOB(java.lang.Long id,
java.io.DataOutput os,
boolean closeOS)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
long |
getBLOB(java.lang.Long id,
java.io.DataOutput os,
boolean closeOS,
java.lang.Long backuppingBPId)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
byte[] |
getBLOB(java.lang.Long id,
java.lang.Long backuppingBPId)
get the BLOB belonging to BO[id].
|
long |
getBLOB(java.lang.Long id,
java.io.OutputStream os)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
long |
getBLOB(java.lang.Long id,
java.io.OutputStream os,
boolean closeOS)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
long |
getBLOB(java.lang.Long id,
java.io.OutputStream os,
boolean closeOS,
java.lang.Long backuppingBPId)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
VFile |
getBLOBInfo(java.lang.Long id)
gathers information about the BLOB belonging to BO[i].
|
VFile |
getBLOBInfo(java.lang.Long id,
java.lang.Long backuppingBPId)
gathers information about the BLOB belonging to BO[i].
|
BO |
getBO(java.lang.Long id)
wrapper for getBO(id, null).
|
BO |
getBO(java.lang.Long id,
java.lang.Class<? extends BOI> classtip)
Returns the BO with the given id.
|
BO[] |
getBOs(long[] ids)
wrapper for getBOs(ids, null)
|
BO[] |
getBOs(java.lang.Long[] ids)
wrapper for getBOs(ids, null)
|
BO[] |
getBOs(long[] ids,
java.lang.Class<? extends BOI> classtip)
returns the BOs with the given ids.
|
BO[] |
getBOs(java.lang.Long[] ids,
java.lang.Class<? extends BOI> classtip)
returns the BOs with the given ids.
|
BOT |
getBOT(java.lang.Class<? extends BOI> clazz) |
BO |
getBOUncached(java.lang.Long id) |
BO |
getBOUncached(java.lang.Long id,
java.lang.Class<? extends BOI> classtip)
Loads and returns the BO with this Id with a non caching BOLoader.
|
CryptoHandlerI |
getCryptoHandler()
get a reference to the CryptoHandler used.
|
DBManEventProviderI |
getEventProvider()
Returns the DBManEventProviderI of this BOLoader, if any.
|
FeatureManagerI |
getFeatureManager() |
FileVaultI |
getFileVault() |
java.lang.Long |
getNextId()
get a unique Long id from the backend.
|
BOLoaderI |
getParentLoader()
returns the BOLoader which this BOLoader uses to load its objects.
|
PersistenceHandlerI |
getPersistenceHandler() |
PersistenceHandlerI |
getPh() |
BO[] |
getRelationBOs(java.lang.Long id,
java.lang.Class<? extends BOI> classtip,
java.lang.String attName)
this method is used by the lazy loading map/list implementation to load related
objects when needed.
|
BOLoaderI |
getRootLoader()
Returns the root BOLoader of this BOLoader or this if there is no more parent loader.
|
SchemaI |
getSchema()
gets a reference to the schema which is used by this BOLoader.
|
BackendSessionI |
getSession() |
TransactionBuilderI |
getTransactionBuilder()
Deprecated.
please use a ServerLocalTransactionI instead, built via DBManLocalI::getServerLocalTransaction
|
TransactionProviderI |
getTransactionProvider()
Deprecated.
please use a ServerLocalTransactionI instead, built via DBManLocalI::getServerLocalTransaction
|
boolean |
hasBLOB(java.lang.Long id) |
boolean |
hasBLOB(java.lang.Long id,
java.lang.Long backuppingBPId) |
java.util.BitSet |
haveBLOB(long[] ids) |
boolean |
isAnsweringBackendQuery()
Checks if this loader is currently answering a backend query.
|
boolean |
isCaching()
If true, then this BOLoaderI uses an internal cache, holding all BOs hat were loaded or frapped into it.
|
java.lang.Boolean |
isLoggedIn(Benutzer user)
Tells if the given Benutzer is currently logged in.
|
boolean |
isLoggedInNN(Benutzer user)
Tells if the given Benutzer is currently logged in.
|
boolean |
isRecording()
Returns true if this BOLoaderI records changes.
|
java.lang.Long |
nextTempId()
Generates the next temporary Id, using the current session as the Id supplier if available.
|
BatchedBackendRequestI |
prepareQuery(java.lang.String s) |
BatchedBackendRequestI |
prepareQuery(java.lang.String s,
java.lang.Object[] o) |
de.ipcon.db.core.QueryResultsI |
query(BOQuery boQuery)
query objects in an iterative way to hide backend processing time.
|
de.ipcon.db.core.QueryResultsI |
query(java.lang.String query)
wrapper for query(t, Object[0])
|
de.ipcon.db.core.QueryResultsI |
query(java.lang.String query,
java.lang.Object[] params)
query objects in an iterative way to hide backend processing time.
|
java.util.List |
queryBO(BOQuery boQuery)
query objects and block until all objects are transferred, returns Objects as a List.
|
java.util.List |
queryBO(java.lang.String query)
wrapper for queryBO(String, Object[0])
|
java.util.List |
queryBO(java.lang.String query,
java.lang.Object[] params)
query objects and block until all objects are transferred, returns Objects as a List.
|
de.ipcon.db.core.QueryResultsI |
queryRelation(long id,
java.lang.Class<? extends BOI> classtip,
java.lang.String attributeName)
does the same as @see #getRelationBOs, but returns a QueryResultsI like @see #query.
|
void |
setPh(PersistenceHandlerI persistenceHandler)
Sets the persistence handler for this loader.
|
void |
setSchema(SchemaI _schema) |
void |
setSession(BackendSessionI s) |
java.lang.Long |
testAuth(Anmeldung a)
Tests wether given credentials can be verified.
|
boolean |
testAuth(de.ipcon.db.core.PasswortUeberpruefung a)
Tests wether given credentials can be verified.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindisServerSidefrapBOArrayFromCache, frapBOIArrayFromCache, frapBOsFromCache, frapFromCache, isAncestorOf, isRootLoader, isServerSide, isTesting, prepareQueryhaveBLOB, haveBLOBgetBOByAttr, getBOByAttr, getBOByAttr, getBOByAttrs, getBOByAttrs, getBOByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getOneBOByAttr, getUniqueBOByAttrpublic DBManLocalBOLoader(DBManLocalI _dbman)
public DBManLocalBOLoader(DBManLocalI _dbman, BackendSessionI _session)
public DBManLocalBOLoader(DBManLocalI _dbman, BackendSessionI _session, boolean _intendedForSaving)
public PersistenceHandlerI getPersistenceHandler()
getPersistenceHandler in interface BackendBOLoaderWithPersistenceHandlerIpublic void clearPersistenceHandler()
clearPersistenceHandler in interface BackendBOLoaderWithPersistenceHandlerIpublic BackendSessionI getSession()
public void setSession(BackendSessionI s)
@Deprecated public TransactionProviderI getTransactionProvider()
@Deprecated public TransactionBuilderI getTransactionBuilder()
public boolean isAnsweringBackendQuery()
BackendQueryAnsweringBOLoaderIisAnsweringBackendQuery in interface BackendQueryAnsweringBOLoaderItrue if the loader is answering a backend query, false otherwise.public java.lang.Long nextTempId()
This method overrides the nextTempId method from the BackendQueryAnsweringBOLoaderI interface to provide a consistent way of generating temporary Ids within a backend query session. If a session is active, it is used as the Id supplier; otherwise, a local Id counter is used.
nextTempId in interface BackendQueryAnsweringBOLoaderIpublic void setPh(PersistenceHandlerI persistenceHandler)
BackendQueryAnsweringBOLoaderIsetPh in interface BackendQueryAnsweringBOLoaderIpersistenceHandler - The persistence handler to set.public SchemaI getSchema()
BOLoaderIgetSchema in interface BOLoaderIgetSchema in interface SchemaProviderIpublic void setSchema(SchemaI _schema)
public CryptoHandlerI getCryptoHandler()
BOLoaderIgetCryptoHandler in interface BOLoaderIpublic FileVaultI getFileVault()
getFileVault in interface BOLoaderIpublic FeatureManagerI getFeatureManager()
getFeatureManager in interface BOLoaderIpublic boolean exists(java.lang.Long id)
BOLoaderIexists in interface BOLoaderIBOLoaderI.exists(Long, Class)public boolean exists(java.lang.Long id,
java.lang.Class<? extends BOI> classtip)
BOLoaderIpublic BO getBO(java.lang.Long id)
BOLoaderIgetBO in interface BOLoaderIBOLoaderI.getBO(Long, Class)public BO getBO(java.lang.Long id, java.lang.Class<? extends BOI> classtip)
BOLoaderIpublic BO getBOUncached(java.lang.Long id)
getBOUncached in interface BOLoaderIpublic BO getBOUncached(java.lang.Long id, java.lang.Class<? extends BOI> classtip)
BOLoaderIBOLoaderI.isCaching() BOLoaderI instances.getBOUncached in interface BOLoaderIpublic BO[] getBOs(java.lang.Long[] ids)
BOLoaderIgetBOs in interface BOLoaderIBOLoaderI.getBOs(Long[],Class)public BO[] getBOs(java.lang.Long[] ids, java.lang.Class<? extends BOI> classtip)
BOLoaderIgetBOs in interface BOLoaderIids - array of Longs with ids for the requested BOs.classtip - guess for classes which the BOs belong to, may be null.Transactionpublic BO[] getBOs(long[] ids)
BOLoaderIgetBOs in interface BOLoaderIBOLoaderI.getBOs(long[],Class)public BO[] getBOs(long[] ids, java.lang.Class<? extends BOI> classtip)
BOLoaderIgetBOs in interface BOLoaderIids - array of longs with ids for the requested BOs.classtip - guess for classes which the BOs belong to, may be null.Transactionpublic BO[] getRelationBOs(java.lang.Long id, java.lang.Class<? extends BOI> classtip, java.lang.String attName)
BOLoaderIgetRelationBOs in interface BOLoaderIid - id of the BO which the requested BOs has a relation toclasstip - common superclass of the requested bosattName - name of the relation from the BO to the requested onespublic de.ipcon.db.core.QueryResultsI queryRelation(long id,
java.lang.Class<? extends BOI> classtip,
java.lang.String attributeName)
BOLoaderIqueryRelation in interface BOLoaderIpublic de.ipcon.db.core.QueryResultsI query(java.lang.String query)
BOLoaderIquery in interface BOLoaderIquery in interface BOQueryLoaderIBOLoaderI.query(String, Object[])public de.ipcon.db.core.QueryResultsI query(java.lang.String query,
java.lang.Object[] params)
BOLoaderIThis sample shows how to query bla BOs though this method
do
it = bol.query("bla from pack.bo bla where not Ldel limit 2")
loop while it.hasNext()
bo = BO it.getCurrentObject() -- hopefully this IS a BO, depends on the query.
-- do whatever you have to do with the bo
finally
it.close()
end
The finally clause is very important to free up database and backend resources,
so please don't forget this step!query in interface BOLoaderIquery in interface BOQueryLoaderIquery in interface GrooqlBOLoaderIquery - the query to fetch, written in OQLparams - an object array corresponding with $n entries, $1 is pvals[0] and so forth. Must not be null.public java.util.List queryBO(java.lang.String query)
BOLoaderIqueryBO in interface BOLoaderIqueryBO in interface BOQueryLoaderIBOLoaderI.queryBO(String, Object[])public java.util.List queryBO(java.lang.String query,
java.lang.Object[] params)
BOLoaderIqueryBO in interface BOLoaderIqueryBO in interface BOQueryLoaderIqueryBO in interface GrooqlBOLoaderIquery - the query to fetch, written in OQLparams - an object array corresponding with $n entries, $1 is pvals[0] and so forth. Must not be null.BOLoaderI.query(String, Object[])public de.ipcon.db.core.QueryResultsI query(BOQuery boQuery)
BOLoaderIpublic java.util.List queryBO(BOQuery boQuery)
BOLoaderIpublic byte[] getBLOB(java.lang.Long id)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs to.public byte[] getBLOB(java.lang.Long id,
java.lang.Long backuppingBPId)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs to.backuppingBPId - instead of the current BLOB get and stream
the backup-BLOB that was stored because of this BP-Id from the backup-dirpublic long getBLOB(java.lang.Long id,
java.io.OutputStream os)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the OutputStream to write the BLOB-bytes topublic long getBLOB(java.lang.Long id,
java.io.OutputStream os,
boolean closeOS)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the OutputStream to write the BLOB-bytes tocloseOS - a boolean designating if the OutputStream shall be closed afterwards or not.public long getBLOB(java.lang.Long id,
java.io.OutputStream os,
boolean closeOS,
java.lang.Long backuppingBPId)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the OutputStream to write the BLOB-bytes tocloseOS - a boolean designating if the OutputStream shall be closed afterwards or not.backuppingBPId - instead of the current BLOB get and stream
the backup-BLOB that was stored because of this BP-Id from the backup-dirpublic long getBLOB(java.lang.Long id,
java.io.DataOutput os)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the DataOutput to write the BLOB-bytes topublic long getBLOB(java.lang.Long id,
java.io.DataOutput os,
boolean closeOS)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the DataOutput to write the BLOB-bytes tocloseOS - a boolean designating if the DataOutput shall be closed afterwards or not.public long getBLOB(java.lang.Long id,
java.io.DataOutput os,
boolean closeOS,
java.lang.Long backuppingBPId)
BLOBLoaderIgetBLOB in interface BLOBLoaderIid - the id of the BO the BLOB belongs toos - the DataOutput to write the BLOB-bytes tocloseOS - a boolean designating if the DataOutput shall be closed afterwards or not.backuppingBPId - instead of the current BLOB get and stream
the backup-BLOB that was stored because of this BP-Id from the backup-dirpublic VFile getBLOBInfo(java.lang.Long id)
BLOBLoaderIgetBLOBInfo in interface BLOBLoaderIid - the id of the BO the BLOB-info belongs to.public VFile getBLOBInfo(java.lang.Long id, java.lang.Long backuppingBPId)
BLOBLoaderIgetBLOBInfo in interface BLOBLoaderIid - the id of the BO the BLOB-info belongs to.backuppingBPId - instead of the current BLOB get the VFile for
the backup-BLOB that was stored because of this BP-Id from the backup-dirpublic boolean hasBLOB(java.lang.Long id)
hasBLOB in interface BLOBLoaderIid - the id of the BO the check for existence of a BLOB on the server.public boolean hasBLOB(java.lang.Long id,
java.lang.Long backuppingBPId)
hasBLOB in interface BLOBLoaderIid - the id of the BO the check for existence of a BLOB on the server.backuppingBPId - instead of the current BLOB get the VFile for
the backup-BLOB that was stored because of this BP-Id from
the backup-dirpublic java.util.BitSet haveBLOB(long[] ids)
haveBLOB in interface BLOBLoaderIids - an array of ids of BOs the check for existence of a BLOB on the server.public java.lang.Long getNextId()
BOLoaderIpublic java.lang.Long testAuth(Anmeldung a)
BOLoaderIpublic boolean testAuth(de.ipcon.db.core.PasswortUeberpruefung a)
BOLoaderIpublic BatchedBackendRequestI prepareQuery(java.lang.String s)
prepareQuery in interface BOLoaderIpublic BatchedBackendRequestI prepareQuery(java.lang.String s, java.lang.Object[] o)
prepareQuery in interface BOLoaderIpublic void execute(BatchedBackendRequestI[] srs)
public java.lang.Boolean isLoggedIn(Benutzer user)
BOLoaderIisLoggedIn in interface BOLoaderIuser - the Benutzer for which the logged in state should be checkedpublic boolean isLoggedInNN(Benutzer user)
BOLoaderIisLoggedInNN in interface BOLoaderIuser - the Benutzer for which the logged in state should be checkedpublic void drain()
BOLoaderIBOLoaderI.isCaching() returns false, this is a nop.public boolean isCaching()
BOLoaderIpublic boolean isRecording()
BOLoaderIisRecording in interface BOLoaderIpublic BO frapFromCache(BO bo)
BOLoaderIfrapFromCache in interface BOLoaderIpublic BOLoaderI getParentLoader()
BOLoaderIgetParentLoader in interface BOLoaderIpublic BOLoaderI getRootLoader()
BOLoaderIgetRootLoader in interface BOLoaderIpublic DBManEventProviderI getEventProvider()
BOLoaderIgetEventProvider in interface BOLoaderIpublic PersistenceHandlerI getPh()
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.