|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rjw.dc.db.Database
Holder of the Database connection and information. Starts the QueryQueue and handles update, insert and select statements.
On the first start, the Database will be created (if the database is empty; the tables do not exist). If this fails, a message is shown to the user.
For new records, the unique ID is created by this class. This has not been perfected at this moment.
Constructor Summary | |
Database()
Initializes the Database, creates a new one if necessary |
Method Summary | |
static void |
close()
|
void |
deleteCollection(DataCrowCollection collection,
RequestorCollection requestors)
|
void |
deleteValues(DataCrowObject o,
RequestorCollection requestors)
Deletes values from the database. |
void |
init()
Starts the query queue and initializes the database connection |
void |
insertCollection(DataCrowCollection collection,
RequestorCollection requestors)
|
void |
insertValues(DataCrowObject o,
RequestorCollection requestors)
Inserts new values. |
void |
runQuery(java.lang.String sQuery,
RequestorCollection requestors)
Runs a predefined query |
java.lang.Object |
runQueryDirect(DataCrowObject o)
Runs a query directly, bypassing the query queue |
java.lang.Object |
runQueryDirect(Query query)
Does not put the query in a queue but executes it immediately. |
java.lang.Object |
runQueryDirect(java.lang.String sQuery)
Does not put the query in a queue but executes it immediately. |
void |
searchValues(DataCrowObject o,
QueryOptions options,
RequestorCollection requestors)
Searches for values. |
boolean |
uniqueValues(DataCrowObject o,
boolean bUpdateQuery)
Checks whether the values are unique (do not exist as yet in the database). |
void |
updateCollection(DataCrowCollection collection,
RequestorCollection requestors)
|
void |
updateValues(DataCrowObject o,
RequestorCollection requestors)
Updates values. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Database()
Method Detail |
public static void close()
public void init()
DatabaseConnection
,
QueryQueue
public void insertCollection(DataCrowCollection collection, RequestorCollection requestors)
public void updateCollection(DataCrowCollection collection, RequestorCollection requestors)
public void deleteCollection(DataCrowCollection collection, RequestorCollection requestors)
public void runQuery(java.lang.String sQuery, RequestorCollection requestors)
sQuery
- query statementrequestors
- requests to the UIpublic java.lang.Object runQueryDirect(java.lang.String sQuery)
sQuery
- query statementpublic java.lang.Object runQueryDirect(DataCrowObject o)
public java.lang.Object runQueryDirect(Query query)
public void searchValues(DataCrowObject o, QueryOptions options, RequestorCollection requestors)
o
- the object which is used as the conditionoptions
- query optionsrequestors
- requestors for the result of the query (UI)public void updateValues(DataCrowObject o, RequestorCollection requestors)
o
- the object to be updatedrequestors
- requestors which depend on the outcome of the querypublic void insertValues(DataCrowObject o, RequestorCollection requestors)
o
- the object to be insertedrequestors
- requestors which depend on the outcome of the querypublic void deleteValues(DataCrowObject o, RequestorCollection requestors)
o
- the object to be deletedrequestors
- requestors which depend on the outcome of the querypublic boolean uniqueValues(DataCrowObject o, boolean bUpdateQuery)
o
- object to be checkedbUpdateQuery
- specifies whether this is an update or an insert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |