public class RemoteDatabase<C extends ClientContext> extends java.lang.Object implements Database, ClientObject<C>
DBRecord
s 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
Database
public DBRecord[] dbSelectRecords(DBRecord master, SqlCondition condition) throws java.lang.Exception
Database
Database.dbSelectRecords(DBRecord, SqlCondition, SqlOrder)
. The default order is by
primary key.dbSelectRecords
in interface Database
java.lang.Exception
public DBRecord[] dbSelectRecords(DBRecord master, SqlCondition condition, SqlOrder order) throws java.lang.Exception
Database
dbSelectRecords
in interface Database
java.lang.Exception
public DBRecord[] dbInsertRecords(DBRecord... records) throws java.lang.Exception
Database
dbInsertRecords
in interface Database
java.lang.Exception
public DBRecord dbInsert(DBRecord record) throws java.lang.Exception
Database
dbInsert
in interface Database
java.lang.Exception
Database.dbInsertRecords(DBRecord[])
public void dbUpdate(DBRecord... records) throws java.lang.Exception
Database
public void dbDelete(DBRecord... records) throws java.lang.Exception
Database
public DBRecord dbRehash(DBRecord record) throws java.lang.Exception
Database
dbRehash
in interface Database
java.lang.Exception
Database.dbRehashRecords(DBRecord[])
public DBRecord[] dbRehashRecords(DBRecord... records) throws java.lang.Exception
Database
dbRehashRecords
in interface Database
java.lang.Exception
public void dbLoadRecords(DBRecord master, DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
Database
Database.dbLoadRecords(DBRecord, DBLoadMonitor, SqlCondition)
. The default order is by
primary key.dbLoadRecords
in interface Database
java.lang.Exception
public void dbLoadRecords(DBRecord master, DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
Database
DBLoadMonitor
is responsible for collecting or processing the records.dbLoadRecords
in interface Database
java.lang.Exception
public DBRecord[] dbSearchRecords(DBRecord master, SqlCondition condition, SqlOrder order) throws java.lang.Exception
Database
ComposedRecord
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 Database
java.lang.Exception
public DBObject dbStore(DBObject record) throws java.lang.Exception
Database
DBObject.forceUpdate()
method.
If the record exists already it will be updated, otherwise it will be inserted.dbStore
in interface Database
java.lang.Exception
Database.dbStoreRecords(DBObject[])
public DBObject[] dbStoreRecords(DBObject... dbos) throws java.lang.Exception
Database
DBObject.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 Database
java.lang.Exception
public final C getClientContext()
ClientObject
getClientContext
in interface ClientObject<C extends ClientContext>
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014 EsprIT-Systems. All Rights Reserved.