public class RemoteDatabase<C extends ClientContext> extends java.lang.Object implements Database, ClientObject<C>
DBRecords and performs
them on a remote database.Database| Constructor and Description |
|---|
RemoteDatabase(C clientCtx) |
| Modifier and Type | Method and Description |
|---|---|
void |
dbDelete(DBRecord... records)
Performs a database request that to delete the given record(s) from the database.
|
DBRecord |
dbInsert(DBRecord record)
Inserts the record into the database.
|
DBRecord[] |
dbInsertRecords(DBRecord... records)
Performs a database request to insert the given records into the database.
|
void |
dbLoadRecords(DBRecord master,
DBLoadMonitor monitor,
SqlCondition condition)
|
void |
dbLoadRecords(DBRecord master,
DBLoadMonitor monitor,
SqlCondition condition,
SqlOrder order)
Performs a database request to load records of the given type with the given condition and
order.
|
DBRecord |
dbRehash(DBRecord record)
Performs a database request to rehash the given record.
|
DBRecord[] |
dbRehashRecords(DBRecord... records)
Performs a database request that tries to rehash the given records.
|
DBRecord[] |
dbSearchRecords(DBRecord master,
SqlCondition condition,
SqlOrder order)
Performs a database request to select
ComposedRecord instances by a
SqlCondition that may contain fields of different record parts (the composing
DBObjects). |
DBRecord |
dbSelect(DBRecord master,
java.lang.String... primaryKey)
Performs a database request to fetch a single record by primary key.
|
DBRecord[] |
dbSelectRecords(DBRecord master,
SqlCondition condition)
|
DBRecord[] |
dbSelectRecords(DBRecord master,
SqlCondition condition,
SqlOrder order)
Performs a database request to read records of the given type with the given condition and
order.
|
DBObject |
dbStore(DBObject record)
Performs a database request to store the given DBobject with its
DBObject.forceUpdate() method. |
DBObject[] |
dbStoreRecords(DBObject... dbos)
Performs a database request to store the given records with their
DBObject.forceUpdate() method. |
void |
dbUpdate(DBRecord... records)
Performs a database request to update the given record(s) in the database.
|
C |
getClientContext()
Returns the the client runtime environment
|
java.lang.String |
toString() |
public RemoteDatabase(C clientCtx)
public DBRecord dbSelect(DBRecord master, java.lang.String... primaryKey) throws java.lang.Exception
Databasepublic DBRecord[] dbSelectRecords(DBRecord master, SqlCondition condition) throws java.lang.Exception
DatabaseDatabase.dbSelectRecords(DBRecord, SqlCondition, SqlOrder). The default order is by
primary key.dbSelectRecords in interface Databasejava.lang.Exceptionpublic DBRecord[] dbSelectRecords(DBRecord master, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DatabasedbSelectRecords in interface Databasejava.lang.Exceptionpublic DBRecord[] dbInsertRecords(DBRecord... records) throws java.lang.Exception
DatabasedbInsertRecords in interface Databasejava.lang.Exceptionpublic DBRecord dbInsert(DBRecord record) throws java.lang.Exception
DatabasedbInsert in interface Databasejava.lang.ExceptionDatabase.dbInsertRecords(DBRecord[])public void dbUpdate(DBRecord... records) throws java.lang.Exception
Databasepublic void dbDelete(DBRecord... records) throws java.lang.Exception
Databasepublic DBRecord dbRehash(DBRecord record) throws java.lang.Exception
DatabasedbRehash in interface Databasejava.lang.ExceptionDatabase.dbRehashRecords(DBRecord[])public DBRecord[] dbRehashRecords(DBRecord... records) throws java.lang.Exception
DatabasedbRehashRecords in interface Databasejava.lang.Exceptionpublic void dbLoadRecords(DBRecord master, DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
DatabaseDatabase.dbLoadRecords(DBRecord, DBLoadMonitor, SqlCondition). The default order is by
primary key.dbLoadRecords in interface Databasejava.lang.Exceptionpublic void dbLoadRecords(DBRecord master, DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DatabaseDBLoadMonitor is responsible for collecting or processing the records.dbLoadRecords in interface Databasejava.lang.Exceptionpublic DBRecord[] dbSearchRecords(DBRecord master, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DatabaseComposedRecord instances by a
SqlCondition that may contain fields of different record parts (the composing
DBObjects). The statement typically performs a join on several tables.
Note that classes with composed primary keys are not supported yet.dbSearchRecords in interface Databasejava.lang.Exceptionpublic DBObject dbStore(DBObject record) throws java.lang.Exception
DatabaseDBObject.forceUpdate() method.
If the record exists already it will be updated, otherwise it will be inserted.dbStore in interface Databasejava.lang.ExceptionDatabase.dbStoreRecords(DBObject[])public DBObject[] dbStoreRecords(DBObject... dbos) throws java.lang.Exception
DatabaseDBObject.forceUpdate() method.
If the records exist already they will be updated, otherwise they will be inserted.
Note that this only works on DBObjects and not on composed records.dbStoreRecords in interface Databasejava.lang.Exceptionpublic final C getClientContext()
ClientObjectgetClientContext in interface ClientObject<C extends ClientContext>public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014 EsprIT-Systems. All Rights Reserved.