public class TestBOLoaderV2 extends TestBOLoader implements TransactionProviderI
BOQueryLoaderI.InternalHelper
rootPaneToLockOnConnectionInterrupt
Constructor and Description |
---|
TestBOLoaderV2(SchemaI schema) |
TestBOLoaderV2(SchemaI schema,
java.lang.Class[] initialdataClasses) |
TestBOLoaderV2(SchemaI schema,
java.lang.Class[] initialdataClasses,
BO[] _bosInDB) |
TestBOLoaderV2(java.lang.String schemaPath) |
TestBOLoaderV2(java.lang.String schemaPath,
java.lang.Class[] initialdataClasses) |
TestBOLoaderV2(java.lang.String schemaPath,
java.lang.Class[] initialdataClasses,
BO[] _bosInDB) |
Modifier and Type | Method and Description |
---|---|
TestTransaction |
createTransaction()
Creates and returns a new Transaction of type TestTransaction.
|
TestTransaction |
createTransaction(java.lang.String description) |
TestTransaction |
createTransaction(java.lang.String description,
TemporaryIdSupplierI tempIdSupplier) |
void |
drain()
If this BOLoader has a cache, we request it to empty it.
|
void |
dump() |
void |
execute(BatchedBackendRequestI[] srs) |
boolean |
exists(java.lang.Long id)
wrapper for exists(id, null).
|
boolean |
exists(java.lang.Long id,
java.lang.Class 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).
|
long |
getBLOB(java.lang.Long $27,
java.io.DataOutput $28)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
long |
getBLOB(java.lang.Long $29,
java.io.DataOutput $30,
boolean $31)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
long |
getBLOB(java.lang.Long $32,
java.io.DataOutput $33,
boolean $34,
java.lang.Long $35)
Writes the BLOB belonging to BO[id] to the passed DataOutput.
|
long |
getBLOB(java.lang.Long $18,
java.io.OutputStream $19)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
long |
getBLOB(java.lang.Long $20,
java.io.OutputStream $21,
boolean $22)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
long |
getBLOB(java.lang.Long $23,
java.io.OutputStream $24,
boolean $25,
java.lang.Long $26)
Writes the BLOB belonging to BO[id] to the passed OutputStream.
|
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 |
getBO(java.lang.Long id,
java.lang.Class<? extends BO> classtip,
boolean returnNullIfNotFound) |
BOT |
getBOT(java.lang.Class 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.
|
DBManEventProviderI |
getEventProvider()
Returns the DBManEventProviderI of this BOLoader, if any.
|
FeatureManagerI |
getFeatureManager() |
Transaction |
getNewTransaction() |
Transaction |
getNewTransaction(java.lang.String desc) |
Transaction |
getNewTransaction(java.lang.String desc,
TemporaryIdSupplierI tempIdSupplier) |
Transaction |
getNewTransaction(TemporaryIdSupplierI tempIdSupplier) |
Transaction |
getNewTransactionWithInstrumentedSchema() |
Transaction |
getNewTransactionWithInstrumentedSchema(java.lang.String desc) |
Transaction |
getNewTransactionWithInstrumentedSchema(java.lang.String desc,
TemporaryIdSupplierI tempIdSupplier) |
Transaction |
getNewTransactionWithInstrumentedSchema(TemporaryIdSupplierI tempIdSupplier) |
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.
|
BO[] |
getRelationBOs(java.lang.Long id,
java.lang.Class<? extends BO> classtip,
java.lang.String attributeName)
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.
|
boolean |
hasBLOB(java.lang.Long $36,
java.lang.Long $37) |
java.util.BitSet |
haveBLOB(long[] $17) |
void |
injectAdditionalPersistentBOs(java.util.Collection<BO> bos)
Deprecated.
|
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.
|
void |
loadInitialdataFor(java.lang.Class clazz) |
void |
loadInitialdataFor(java.lang.Class[] clazzes) |
static TestBOLoaderV2 |
ofV2(java.lang.String projectPath,
java.lang.Class[] initialdataClasses) |
static TestBOLoaderV2 |
ofV2(java.lang.String projectPath,
java.lang.Class[] initialdataClasses,
BO[] _bosInDB) |
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 query)
wrapper for query(t, Object[0])
|
QueryResultsI |
query(java.lang.String query,
java.lang.Object[] pvals)
query objects in an iterative way to hide backend processing time.
|
java.util.List |
queryBO(BOQuery q)
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[] pvals)
query objects and block until all objects are transferred, returns Objects as a List.
|
QueryResultsI |
queryRelation(long id,
java.lang.Class classtip,
java.lang.String attributeName)
does the same as @see #getRelationBOs, but returns a QueryResultsI like @see #query.
|
TransactionAnswer |
saveBO(Transaction tx)
Persists the changes recorded in the passed transaction tx to the database.
|
TransactionAnswer |
saveBO(Transaction tx,
boolean ignoreConflicts) |
void |
setLastSimulatedNextId(long _lastSimulatedNextId) |
java.lang.Long |
testAuth(Anmeldung a)
Tests wether given credentials can be verified.
|
boolean |
testAuth(PasswortUeberpruefung a)
Tests wether given credentials can be verified.
|
addQueryInterceptor, clearQueryInterceptors, createExpiringToken, createExpiringToken, createInstrumentedTransaction, createInstrumentedTransaction, createInstrumentedTransaction, createTransactionDescWithInitialDataFor, createTransactionWithInitialDataFor, destroyExpiringToken, getBLOB, getBLOB, getBLOBInfo, getBLOBInfo, getBOs, getBOs, getBOs, getBOs, getCryptoHandler, getFileVault, getSchema, getTraceQueryOnEntity, getTx, hasBLOB, isTesting, loadSchema, main, of, parseQueryAndFetchBOs, parseQueryAndFetchBOs, prepareQuery, removeQueryInterceptor, retrieveExpiringToken, setSchema, setTraceQueryOnEntity, setTx
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
saveWithRetries, saveWithRetries
frapBOArrayFromCache, frapBOIArrayFromCache, frapBOsFromCache, frapFromCache, isRootLoader, isServerSide, prepareQuery
haveBLOB, haveBLOB
getBOByAttr, getBOByAttr, getBOByAttr, getBOByAttrs, getBOByAttrs, getBOByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getBOsByAttrs, getOneBOByAttr, getUniqueBOByAttr
public TestBOLoaderV2(java.lang.String schemaPath)
public TestBOLoaderV2(java.lang.String schemaPath, java.lang.Class[] initialdataClasses)
public TestBOLoaderV2(java.lang.String schemaPath, java.lang.Class[] initialdataClasses, BO[] _bosInDB)
public TestBOLoaderV2(SchemaI schema)
public TestBOLoaderV2(SchemaI schema, java.lang.Class[] initialdataClasses)
public void dump()
public static TestBOLoaderV2 ofV2(java.lang.String projectPath, java.lang.Class[] initialdataClasses)
public static TestBOLoaderV2 ofV2(java.lang.String projectPath, java.lang.Class[] initialdataClasses, BO[] _bosInDB)
public void loadInitialdataFor(java.lang.Class clazz)
public void loadInitialdataFor(java.lang.Class[] clazzes)
public void setLastSimulatedNextId(long _lastSimulatedNextId)
@Deprecated public void injectAdditionalPersistentBOs(java.util.Collection<BO> bos)
TestBOLoader
BO
instances to the set of "persistent" BO
s known to this loader (which is the
set of BO
s known to the most recently created Transaction
with this loader).injectAdditionalPersistentBOs
in class TestBOLoader
public FeatureManagerI getFeatureManager()
getFeatureManager
in interface BOLoaderI
getFeatureManager
in class TestBOLoader
public BOT getBOT(java.lang.Class clazz)
getBOT
in interface BOLoaderI
getBOT
in class TestBOLoader
public boolean exists(java.lang.Long id)
BOLoaderI
exists
in interface BOLoaderI
exists
in class TestBOLoader
BOLoaderI.exists(Long, Class)
public boolean exists(java.lang.Long id, java.lang.Class classtip)
BOLoaderI
exists
in interface BOLoaderI
exists
in class TestBOLoader
id
- the id of the BOclasstip
- a guess which class the object has. May be null.public BO getBO(java.lang.Long id)
BOLoaderI
getBO
in interface BOLoaderI
getBO
in class TestBOLoader
BOLoaderI.getBO(Long, Class)
public BO getBO(java.lang.Long id, java.lang.Class<? extends BO> classtip)
BOLoaderI
getBO
in interface BOLoaderI
getBO
in class TestBOLoader
id
- the id of the BOclasstip
- a guess which class the object has. May be null.public BO getBO(java.lang.Long id, java.lang.Class<? extends BO> classtip, boolean returnNullIfNotFound)
public BO getBOUncached(java.lang.Long id)
getBOUncached
in interface BOLoaderI
getBOUncached
in class TestBOLoader
public BO getBOUncached(java.lang.Long id, java.lang.Class<? extends BO> classtip)
BOLoaderI
BOLoaderI.isCaching()
BOLoaderI instances.getBOUncached
in interface BOLoaderI
getBOUncached
in class TestBOLoader
public BO[] getRelationBOs(java.lang.Long id, java.lang.Class<? extends BO> classtip, java.lang.String attributeName) throws ObjectNotFoundException
BOLoaderI
getRelationBOs
in interface BOLoaderI
getRelationBOs
in class TestBOLoader
id
- id of the BO which the requested BOs has a relation toclasstip
- common superclass of the requested bosattributeName
- name of the relation from the BO to the requested onesObjectNotFoundException
public QueryResultsI query(java.lang.String query)
BOLoaderI
query
in interface BOLoaderI
query
in interface BOQueryLoaderI
query
in class TestBOLoader
BOLoaderI.query(String, Object[])
public QueryResultsI query(java.lang.String query, 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
query
in class TestBOLoader
query
- 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
query
in interface BOLoaderI
query
in class TestBOLoader
eq
- the query to fetch, written in OQLpublic QueryResultsI queryRelation(long id, java.lang.Class classtip, java.lang.String attributeName)
BOLoaderI
queryRelation
in interface BOLoaderI
queryRelation
in class TestBOLoader
public java.util.List queryBO(java.lang.String query) throws java.lang.IllegalArgumentException
BOLoaderI
queryBO
in interface BOLoaderI
queryBO
in interface BOQueryLoaderI
queryBO
in class TestBOLoader
java.lang.IllegalArgumentException
BOLoaderI.queryBO(String, Object[])
public java.util.List queryBO(java.lang.String query, java.lang.Object[] pvals) throws java.lang.IllegalArgumentException
BOLoaderI
queryBO
in interface BOLoaderI
queryBO
in interface BOQueryLoaderI
queryBO
in interface GrooqlBOLoaderI
queryBO
in class TestBOLoader
query
- 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.java.lang.IllegalArgumentException
BOLoaderI.query(String, Object[])
public java.util.List queryBO(BOQuery q)
BOLoaderI
queryBO
in interface BOLoaderI
queryBO
in class TestBOLoader
q
- the query to fetch, written in OQLpublic java.lang.Long getNextId()
BOLoaderI
getNextId
in interface BOLoaderI
getNextId
in class TestBOLoader
public java.lang.Long testAuth(Anmeldung a)
BOLoaderI
testAuth
in interface BOLoaderI
testAuth
in class TestBOLoader
public boolean testAuth(PasswortUeberpruefung a)
BOLoaderI
testAuth
in interface BOLoaderI
testAuth
in class TestBOLoader
public BatchedBackendRequestI prepareQuery(java.lang.String s, java.lang.Object[] o)
prepareQuery
in interface BOLoaderI
prepareQuery
in class TestBOLoader
public void execute(BatchedBackendRequestI[] srs)
execute
in interface BOLoaderI
execute
in class TestBOLoader
public java.lang.Boolean isLoggedIn(Benutzer user)
BOLoaderI
isLoggedIn
in interface BOLoaderI
isLoggedIn
in class TestBOLoader
user
- the Benutzer for which the logged in state should be checkedpublic boolean isLoggedInNN(Benutzer user)
BOLoaderI
isLoggedInNN
in interface BOLoaderI
isLoggedInNN
in class TestBOLoader
user
- the Benutzer for which the logged in state should be checkedpublic void drain()
BOLoaderI
BOLoaderI.isCaching()
returns false
, this is a nop.drain
in interface BOLoaderI
drain
in class TestBOLoader
public boolean isCaching()
BOLoaderI
isCaching
in interface BOLoaderI
isCaching
in class TestBOLoader
public boolean isRecording()
BOLoaderI
isRecording
in interface BOLoaderI
isRecording
in class TestBOLoader
public BO frapFromCache(BO bo)
BOLoaderI
frapFromCache
in interface BOLoaderI
frapFromCache
in class TestBOLoader
public BOLoaderI getParentLoader()
BOLoaderI
getParentLoader
in interface BOLoaderI
getParentLoader
in class TestBOLoader
public BOLoaderI getRootLoader()
BOLoaderI
getRootLoader
in interface BOLoaderI
getRootLoader
in class TestBOLoader
public DBManEventProviderI getEventProvider()
BOLoaderI
getEventProvider
in interface BOLoaderI
getEventProvider
in class TestBOLoader
public TransactionAnswer saveBO(Transaction tx)
TransactionProviderI
saveBO
in interface TransactionProviderI
tx
- the Transaction to savepublic TransactionAnswer saveBO(Transaction tx, boolean ignoreConflicts)
saveBO
in interface TransactionProviderI
public TestTransaction createTransaction()
TestBOLoader
createTransaction
in class TestBOLoader
public TestTransaction createTransaction(java.lang.String description)
createTransaction
in class TestBOLoader
public TestTransaction createTransaction(java.lang.String description, TemporaryIdSupplierI tempIdSupplier)
createTransaction
in class TestBOLoader
public Transaction getNewTransaction()
getNewTransaction
in interface TransactionBuilderI
public Transaction getNewTransaction(TemporaryIdSupplierI tempIdSupplier)
getNewTransaction
in interface TransactionBuilderI
public Transaction getNewTransaction(java.lang.String desc)
getNewTransaction
in interface TransactionBuilderI
public Transaction getNewTransaction(java.lang.String desc, TemporaryIdSupplierI tempIdSupplier)
getNewTransaction
in interface TransactionBuilderI
public Transaction getNewTransactionWithInstrumentedSchema()
getNewTransactionWithInstrumentedSchema
in interface TransactionBuilderI
public Transaction getNewTransactionWithInstrumentedSchema(TemporaryIdSupplierI tempIdSupplier)
getNewTransactionWithInstrumentedSchema
in interface TransactionBuilderI
public Transaction getNewTransactionWithInstrumentedSchema(java.lang.String desc)
getNewTransactionWithInstrumentedSchema
in interface TransactionBuilderI
public Transaction getNewTransactionWithInstrumentedSchema(java.lang.String desc, TemporaryIdSupplierI tempIdSupplier)
getNewTransactionWithInstrumentedSchema
in interface TransactionBuilderI
public java.util.BitSet haveBLOB(long[] $17)
haveBLOB
in interface BLOBLoaderI
haveBLOB
in class TestBOLoader
$17
- an array of ids of BOs the check for existence of a BLOB on the server.public long getBLOB(java.lang.Long $18, java.io.OutputStream $19)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$18
- the id of the BO the BLOB belongs to$19
- the OutputStream to write the BLOB-bytes topublic long getBLOB(java.lang.Long $20, java.io.OutputStream $21, boolean $22)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$20
- the id of the BO the BLOB belongs to$21
- the OutputStream to write the BLOB-bytes to$22
- a boolean designating if the OutputStream shall be closed afterwards or not.public long getBLOB(java.lang.Long $23, java.io.OutputStream $24, boolean $25, java.lang.Long $26)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$23
- the id of the BO the BLOB belongs to$24
- the OutputStream to write the BLOB-bytes to$25
- a boolean designating if the OutputStream shall be closed afterwards or not.$26
- 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 $27, java.io.DataOutput $28)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$27
- the id of the BO the BLOB belongs to$28
- the DataOutput to write the BLOB-bytes topublic long getBLOB(java.lang.Long $29, java.io.DataOutput $30, boolean $31)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$29
- the id of the BO the BLOB belongs to$30
- the DataOutput to write the BLOB-bytes to$31
- a boolean designating if the DataOutput shall be closed afterwards or not.public long getBLOB(java.lang.Long $32, java.io.DataOutput $33, boolean $34, java.lang.Long $35)
BLOBLoaderI
getBLOB
in interface BLOBLoaderI
getBLOB
in class TestBOLoader
$32
- the id of the BO the BLOB belongs to$33
- the DataOutput to write the BLOB-bytes to$34
- a boolean designating if the DataOutput shall be closed afterwards or not.$35
- instead of the current BLOB get and stream
the backup-BLOB that was stored because of this BP-Id from the backup-dirpublic boolean hasBLOB(java.lang.Long $36, java.lang.Long $37)
hasBLOB
in interface BLOBLoaderI
hasBLOB
in class TestBOLoader
$36
- the id of the BO the check for existence of a BLOB on the server.$37
- instead of the current BLOB get the VFile for
the backup-BLOB that was stored because of this BP-Id from
the backup-dirCopyright © 2000-2024 OAshi S.à r.l. All Rights Reserved.