public class DBManLocalBOLoader extends java.lang.Object implements BackendQueryAnsweringBOLoaderI, BackendBOLoaderWithPersistenceHandlerI
BOQueryLoaderI.InternalHelper
rootPaneToLockOnConnectionInterrupt
Constructor and Description |
---|
DBManLocalBOLoader(DBManLocalI _dbman) |
DBManLocalBOLoader(DBManLocalI _dbman,
BackendSessionI _session) |
Modifier and Type | Method and Description |
---|---|
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 BO> 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 BO> 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 BO> classtip)
returns the BOs with the given ids.
|
BO[] |
getBOs(java.lang.Long[] ids,
java.lang.Class<? extends BO> classtip)
returns the BOs with the given ids.
|
BOT |
getBOT(java.lang.Class<? extends BO> clazz) |
BO |
getBOUncached(java.lang.Long id) |
BO |
getBOUncached(java.lang.Long id,
java.lang.Class<? extends BO> 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 BO> 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()
Returns true if this BackendQueryAnsweringBOLoaderI is actually 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() |
BatchedBackendRequestI |
prepareQuery(java.lang.String s) |
BatchedBackendRequestI |
prepareQuery(java.lang.String s,
java.lang.Object[] o) |
QueryResultsI |
query(BOQuery eq)
query objects in an iterative way to hide backend processing time.
|
QueryResultsI |
query(java.lang.String t)
wrapper for query(t, Object[0])
|
QueryResultsI |
query(java.lang.String t,
java.lang.Object[] pvals)
query objects in an iterative way to hide backend processing time.
|
java.util.List |
queryBO(BOQuery eq)
query objects and block until all objects are transferred, returns Objects as a List.
|
java.util.List |
queryBO(java.lang.String t)
wrapper for queryBO(String, Object[0])
|
java.util.List |
queryBO(java.lang.String t,
java.lang.Object[] pvals)
query objects and block until all objects are transferred, returns Objects as a List.
|
QueryResultsI |
queryRelation(long id,
java.lang.Class<? extends BO> classtip,
java.lang.String attributeName)
does the same as @see #getRelationBOs, but returns a QueryResultsI like @see #query.
|
void |
setPh(PersistenceHandlerI persistenceHandler) |
void |
setSchema(SchemaI _schema) |
void |
setSession(BackendSessionI s) |
java.lang.Long |
testAuth(Anmeldung a)
Tests wether given credentials can be verified.
|
boolean |
testAuth(PasswortUeberpruefung a)
Tests wether given credentials can be verified.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
find
isServerSide
frapBOArrayFromCache, frapBOIArrayFromCache, frapBOsFromCache, frapFromCache, isRootLoader, isServerSide, isTesting, prepareQuery
haveBLOB, haveBLOB
getBOByAttr, getBOByAttr, getBOByAttr, getBOByAttrs, getBOByAttrs, getBOByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getOneBOByAttr, getUniqueBOByAttr
public DBManLocalBOLoader(DBManLocalI _dbman)
public DBManLocalBOLoader(DBManLocalI _dbman, BackendSessionI _session)
public PersistenceHandlerI getPersistenceHandler()
getPersistenceHandler
in interface BackendBOLoaderWithPersistenceHandlerI
public BackendSessionI getSession()
public void setSession(BackendSessionI s)
@Deprecated public TransactionProviderI getTransactionProvider()
@Deprecated public TransactionBuilderI getTransactionBuilder()
public boolean isAnsweringBackendQuery()
BackendQueryAnsweringBOLoaderI
isAnsweringBackendQuery
in interface BackendQueryAnsweringBOLoaderI
public java.lang.Long nextTempId()
nextTempId
in interface BackendQueryAnsweringBOLoaderI
public void setPh(PersistenceHandlerI persistenceHandler)
setPh
in interface BackendQueryAnsweringBOLoaderI
public SchemaI getSchema()
BOLoaderI
getSchema
in interface BOLoaderI
getSchema
in interface SchemaProviderI
public void setSchema(SchemaI _schema)
public CryptoHandlerI getCryptoHandler()
BOLoaderI
getCryptoHandler
in interface BOLoaderI
public FileVaultI getFileVault()
getFileVault
in interface BOLoaderI
public FeatureManagerI getFeatureManager()
getFeatureManager
in interface BOLoaderI
public boolean exists(java.lang.Long id)
BOLoaderI
exists
in interface BOLoaderI
BOLoaderI.exists(Long, Class)
public boolean exists(java.lang.Long id, java.lang.Class<? extends BO> classtip)
BOLoaderI
public BO getBO(java.lang.Long id)
BOLoaderI
getBO
in interface BOLoaderI
BOLoaderI.getBO(Long, Class)
public BO getBO(java.lang.Long id, java.lang.Class<? extends BO> classtip)
BOLoaderI
public BO getBOUncached(java.lang.Long id)
getBOUncached
in interface BOLoaderI
public BO getBOUncached(java.lang.Long id, java.lang.Class<? extends BO> classtip)
BOLoaderI
BOLoaderI.isCaching()
BOLoaderI instances.getBOUncached
in interface BOLoaderI
public BO[] getBOs(java.lang.Long[] ids)
BOLoaderI
getBOs
in interface BOLoaderI
BOLoaderI.getBOs(Long[],Class)
public BO[] getBOs(java.lang.Long[] ids, java.lang.Class<? extends BO> classtip)
BOLoaderI
getBOs
in interface BOLoaderI
ids
- array of Longs with ids for the requested BOs.classtip
- guess for classes which the BOs belong to, may be null.Transaction
public BO[] getBOs(long[] ids)
BOLoaderI
getBOs
in interface BOLoaderI
BOLoaderI.getBOs(long[],Class)
public BO[] getBOs(long[] ids, java.lang.Class<? extends BO> classtip)
BOLoaderI
getBOs
in interface BOLoaderI
ids
- array of longs with ids for the requested BOs.classtip
- guess for classes which the BOs belong to, may be null.Transaction
public BO[] getRelationBOs(java.lang.Long id, java.lang.Class<? extends BO> classtip, java.lang.String attName)
BOLoaderI
getRelationBOs
in interface BOLoaderI
id
- 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 QueryResultsI query(java.lang.String t)
BOLoaderI
query
in interface BOLoaderI
query
in interface BOQueryLoaderI
BOLoaderI.query(String, Object[])
public QueryResultsI query(java.lang.String t, java.lang.Object[] pvals)
BOLoaderI
This 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 BOLoaderI
query
in interface BOQueryLoaderI
query
in interface GrooqlBOLoaderI
t
- the query to fetch, written in OQLpvals
- an object array corresponding with $n entries, $1 is pvals[0] and so forth. Must not be null.public QueryResultsI query(BOQuery eq)
BOLoaderI
public QueryResultsI queryRelation(long id, java.lang.Class<? extends BO> classtip, java.lang.String attributeName)
BOLoaderI
queryRelation
in interface BOLoaderI
public java.util.List queryBO(java.lang.String t)
BOLoaderI
queryBO
in interface BOLoaderI
queryBO
in interface BOQueryLoaderI
BOLoaderI.queryBO(String, Object[])
public java.util.List queryBO(java.lang.String t, java.lang.Object[] pvals)
BOLoaderI
queryBO
in interface BOLoaderI
queryBO
in interface BOQueryLoaderI
queryBO
in interface GrooqlBOLoaderI
t
- the query to fetch, written in OQLpvals
- an object array corresponding with $n entries, $1 is pvals[0] and so forth. Must not be null.BOLoaderI.query(String, Object[])
public java.util.List queryBO(BOQuery eq)
BOLoaderI
public byte[] getBLOB(java.lang.Long id)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- the id of the BO the BLOB belongs to.public byte[] getBLOB(java.lang.Long id, java.lang.Long backuppingBPId)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
id
- 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)
BLOBLoaderI
getBLOBInfo
in interface BLOBLoaderI
id
- the id of the BO the BLOB-info belongs to.public VFile getBLOBInfo(java.lang.Long id, java.lang.Long backuppingBPId)
BLOBLoaderI
getBLOBInfo
in interface BLOBLoaderI
id
- 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 BLOBLoaderI
id
- 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 BLOBLoaderI
id
- 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 BLOBLoaderI
ids
- an array of ids of BOs the check for existence of a BLOB on the server.public java.lang.Long getNextId()
BOLoaderI
public java.lang.Long testAuth(Anmeldung a)
BOLoaderI
public boolean testAuth(PasswortUeberpruefung a)
BOLoaderI
public BatchedBackendRequestI prepareQuery(java.lang.String s)
prepareQuery
in interface BOLoaderI
public BatchedBackendRequestI prepareQuery(java.lang.String s, java.lang.Object[] o)
prepareQuery
in interface BOLoaderI
public void execute(BatchedBackendRequestI[] srs)
public java.lang.Boolean isLoggedIn(Benutzer user)
BOLoaderI
isLoggedIn
in interface BOLoaderI
user
- the Benutzer for which the logged in state should be checkedpublic boolean isLoggedInNN(Benutzer user)
BOLoaderI
isLoggedInNN
in interface BOLoaderI
user
- the Benutzer for which the logged in state should be checkedpublic void drain()
BOLoaderI
BOLoaderI.isCaching()
returns false
, this is a nop.public boolean isCaching()
BOLoaderI
public boolean isRecording()
BOLoaderI
isRecording
in interface BOLoaderI
public BO frapFromCache(BO bo)
BOLoaderI
frapFromCache
in interface BOLoaderI
public BOLoaderI getParentLoader()
BOLoaderI
getParentLoader
in interface BOLoaderI
public BOLoaderI getRootLoader()
BOLoaderI
getRootLoader
in interface BOLoaderI
public DBManEventProviderI getEventProvider()
BOLoaderI
getEventProvider
in interface BOLoaderI
public PersistenceHandlerI getPh()
Copyright © 2000-2024 OAshi S.à r.l. All Rights Reserved.