|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Store
The store interface represents the interface to the database. It is used for inserting, updating, deleting and retrieving objects. You get an object implementing this interface by calling com.groiss.wf.ServiceLocator.getStore() or - in case of RMI - using the getStore() call of com.groiss.wf.Session.
Many methods contain a condition string. The syntax of them is as in an SQL where clause like "name='john' and salary > 1000", where name and salary are database fields of the given object class. In methods where the extra parameter bindVars appears, the condition can contain placeholders, for example "name=? and salary >?".
The condition parameter may always be null, as well as the order parameter. The bindVars may be null if no placeholders are used in the condition.
| Method Summary | ||
|---|---|---|
int |
count(Class<?> c,
String cond,
Object[] bindVars)
This method returns the number of members of a given class matching the given condition. |
|
int |
count(String classname,
String cond,
Object[] bindVars)
This method returns the number of members of a given class matching the given condition. |
|
void |
delete(Class<?> c,
String condition,
Object[] bindVars)
Deletes some objects from the database. |
|
int |
delete(Persistent o)
Deletes the object from the database. |
|
void |
delete(String classname,
String condition,
Object[] bindVars)
Deletes some objects from the database. |
|
int |
executeStatement(String stmt)
Execute a SQL statement. |
|
int |
executeStatement(String stmt,
Object[] bindVars)
Execute a SQL statement. |
|
|
fill(P o)
Fill objects where only the oid is set. |
|
|
get(Class<? extends P> c,
long oid)
Method for getting objects from the database. |
|
|
get(Class<? extends P> c,
String cond)
Method for getting objects from the database. |
|
|
get(Class<? extends P> c,
String cond,
Object[] bindVars)
Method for getting objects from the database. |
|
|
get(String classname,
long oid)
Method for getting objects from the database. |
|
|
get(String classname,
String cond)
Method for getting objects from the database. |
|
|
get(String classname,
String cond,
Object[] bindVars)
Method for getting objects from the database. |
|
|
getNoCache(Class<? extends P> c,
long oid)
Method for getting objects directly from the database bypassing the cache. |
|
long |
getOID()
Return the next object id from the oid-factory in the database |
|
String |
getSchema()
Returns the schema of the tables |
|
TableModel |
getTable(String q,
Object[] bindVars)
Returns the results of the given query. |
|
TableModel |
getTable(String q,
Object[] bindVars,
int[] sqlTypes)
Returns the results of the given query. |
|
Object |
getValue(String stmt)
Execute a SQL statement which returns one value. |
|
Object |
getValue(String stmt,
int sqlType)
Execute a SQL statement which returns one value. |
|
Object |
getValue(String stmt,
Object[] bindVars)
Execute a SQL statement which returns one value. |
|
Object |
getValue(String stmt,
Object[] bindVars,
int sqlType)
Execute a SQL statement which returns one value. |
|
boolean |
hasRows(String stmt,
Object[] bindVars)
Check whether the statement returns results. |
|
boolean |
inDatabase(Persistent o)
Check whether the object is in database |
|
void |
insert(Persistent o)
Insert the object into the database. |
|
|
list(Class<? extends P> c)
This method returns all members of the given class. |
|
|
list(Class<? extends P> c,
String cond)
This method returns the members of the given class matching the given condition. |
|
|
list(Class<? extends P> c,
String cond,
String order)
This method returns the members of the given class matching the given condition. |
|
|
list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars,
int maxRows)
This method returns the members of the given class matching the given condition and limiting the returned entry count. |
|
|
list(String classname)
This method returns all members of the given class. |
|
|
list(String classname,
String cond)
This method returns the members of the given class matching the given condition. |
|
|
list(String classname,
String cond,
String order)
This method returns the members of the given class matching the given condition. |
|
|
list(String classname,
String cond,
String order,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
list2(Class<? extends P> c,
String q,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
list2(String classname,
String q,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
void |
setSchema(String schema)
Set the schema of the tables |
|
|
table(Class<? extends P> c,
String cond,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
table(String classname,
String cond,
Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
int |
update(Persistent o)
Update the database tuple corresponding to the given object. |
|
int |
update(Persistent o,
String... fieldNames)
Update some fields of the database tuple corresponding to the given object. |
|
| Method Detail |
|---|
<P> List<P> list(Class<? extends P> c)
list in interface RemoteStorec - the class of the objects
<P extends Persistent> List<P> list(String classname)
list in interface RemoteStoreclassname - the name of the class of the object
<P> List<P> list(Class<? extends P> c,
String cond)
list in interface RemoteStorec - the class of the objectscond - a SQL condition
<P extends Persistent> List<P> list(String classname,
String cond)
list in interface RemoteStoreclassname - the name of the class of the objectcond - a SQL condition
<P> List<P> list(Class<? extends P> c,
String cond,
String order)
list in interface RemoteStorec - the class of the objectscond - a SQL conditionorder - a comma separated list of attribute names of the given class.
<P extends Persistent> List<P> list(String classname,
String cond,
String order)
list in interface RemoteStoreclassname - the name of the class of the objectcond - a SQL conditionorder - a comma separated list of attribute names of the given class.
<P> List<P> list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars)
list in interface RemoteStorec - the class of the objectscond - a SQL conditionorder - a comma separated list of attribute names of the given class.bindVars - if the condition contains place holders for binding variables this array should contain the values
<P> List<P> list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars,
int maxRows)
list in interface RemoteStorec - the class of the objectscond - a SQL conditionorder - a comma separated list of attribute names of the given class.bindVars - if the condition contains place holders for binding variables this array should contain the valuesmaxRows - the maximum number of entries to return
<P extends Persistent> List<P> list(String classname,
String cond,
String order,
Object[] bindVars)
list in interface RemoteStoreclassname - the name of the class of the objectscond - a SQL conditionorder - a comma separated list of attribute names of the given class.bindVars - if the condition contains place holders for binding variables this array should contain the values
<P> List<P> list2(Class<? extends P> c,
String q,
Object[] bindVars)
StoreUtil.dbAttrs(Persistent, String) dbAttrs(String) method to construct the attribute list,
that is to formulate "select "+StoreUtil.dbAttrs(user,"u")+" from avwuser u, avw_userrole ur where..."
list2 in interface RemoteStorec - the class of the objectsq - a SQL querybindVars - if the condition contains place holders for binding variables this array should contain the values
<P extends Persistent> List<P> list2(String classname,
String q,
Object[] bindVars)
StoreUtil.dbAttrs(Persistent, String) dbAttrs(String) method to construct the attribute list,
that is to formulate "select "+StoreUtil.dbAttrs(user,"u")+" from avwuser u, avw_userrole ur where..."
list2 in interface RemoteStoreclassname - the name of the class of the objectsq - a SQL querybindVars - if the condition contains place holders for binding variables this array should contain the values
<P> Map<Long,P> table(Class<? extends P> c,
String cond,
Object[] bindVars)
table in interface RemoteStorec - the class of the objectscond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
<P extends Persistent> Map<Long,P> table(String classname,
String cond,
Object[] bindVars)
table in interface RemoteStoreclassname - the name of the class of the objectscond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
int count(Class<?> c,
String cond,
Object[] bindVars)
count in interface RemoteStorec - the classcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
int count(String classname,
String cond,
Object[] bindVars)
count in interface RemoteStoreclassname - the name of the classcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
boolean inDatabase(Persistent o)
inDatabase in interface RemoteStore
boolean hasRows(String stmt,
Object[] bindVars)
hasRows in interface RemoteStorestmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
<P> P get(Class<? extends P> c,
long oid)
get in interface RemoteStorec - the class of the objectoid - the oid of the object
<P extends Persistent> P get(String classname,
long oid)
get in interface RemoteStoreclassname - the name of the class of the objectoid - the oid of the object
<P> P get(Class<? extends P> c,
String cond)
get in interface RemoteStorec - the class of the objectcond - a SQL condition
<P extends Persistent> P get(String classname,
String cond)
get in interface RemoteStoreclassname - the name of the class of the objectcond - a SQL condition
<P> P get(Class<? extends P> c,
String cond,
Object[] bindVars)
get in interface RemoteStorec - the class of the objectcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
<P extends Persistent> P get(String classname,
String cond,
Object[] bindVars)
get in interface RemoteStoreclassname - the name of the class of the objectcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
<P> P fill(P o)
fill in interface RemoteStoreo - the object
void insert(Persistent o)
insert in interface RemoteStoreo - the objectint update(Persistent o)
update in interface RemoteStoreo - the object
int update(Persistent o,
String... fieldNames)
update in interface RemoteStoreo - the objectfieldNames - an array containing the names of the fields which should be updatedint delete(Persistent o)
delete in interface RemoteStoreo - the object to delete
void delete(Class<?> c,
String condition,
Object[] bindVars)
Persistent.onDelete() nor PersistentEventHandler.onDelete(Persistent) methods
are called for the individual deleted objects.
delete in interface RemoteStorec - the class of the objectscondition - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
void delete(String classname,
String condition,
Object[] bindVars)
Persistent.onDelete() nor PersistentEventHandler.onDelete(Persistent) methods
are called for the individual deleted objects.
delete in interface RemoteStoreclassname - the name of the class of the objectscondition - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the valuesint executeStatement(String stmt)
executeStatement in interface RemoteStorestmt - the SQL statement text.
int executeStatement(String stmt,
Object[] bindVars)
executeStatement in interface RemoteStorestmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
long getOID()
getOID in interface RemoteStoreObject getValue(String stmt)
getValue in interface RemoteStorestmt - the SQL statement text.
Object getValue(String stmt,
int sqlType)
getValue in interface RemoteStorestmt - the SQL statement text.sqlType - if a special mapping of the database type to java type is needed, the type (java.sql.Types)
can be specified here.
Object getValue(String stmt,
Object[] bindVars)
getValue in interface RemoteStorestmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
Object getValue(String stmt,
Object[] bindVars,
int sqlType)
getValue in interface RemoteStorestmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the valuessqlType - if a special mapping of the database type to java type is needed, the type (java.sql.Types)
can be specified here.
TableModel getTable(String q,
Object[] bindVars)
getTable in interface RemoteStoreq - the sql-querybindVars - if the query contains place holders for binding variables this array should contain the values
TableModel getTable(String q,
Object[] bindVars,
int[] sqlTypes)
getTable in interface RemoteStoreq - the sql-querybindVars - if the query contains place holders for binding variables this array should contain the valuessqlTypes - if a special mapping of database types to java types is needed, the types (java.sql.Types)
can be specified here. The length of the array must be equal to the number of columns in the result set.
void setSchema(String schema)
setSchema in interface RemoteStoreString getSchema()
getSchema in interface RemoteStore
<P> P getNoCache(Class<? extends P> c,
long oid)
getNoCache in interface RemoteStorec - the class of the objectoid - the oid of the object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||