|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface RemoteStore
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)
throws RemoteException
c - the class of the objects
RemoteException
<P extends Persistent> List<P> list(String classname)
throws RemoteException
classname - the name of the class of the object
RemoteException
<P> List<P> list(Class<? extends P> c,
String cond)
throws RemoteException
c - the class of the objectscond - a SQL condition
RemoteException
<P extends Persistent> List<P> list(String classname,
String cond)
throws RemoteException
classname - the name of the class of the objectcond - a SQL condition
RemoteException
<P> List<P> list(Class<? extends P> c,
String cond,
String order)
throws RemoteException
c - the class of the objectscond - a SQL conditionorder - a comma separated list of attribute names of the given class.
RemoteException
<P extends Persistent> List<P> list(String classname,
String cond,
String order)
throws RemoteException
classname - the name of the class of the objectcond - a SQL conditionorder - a comma separated list of attribute names of the given class.
RemoteException
<P> List<P> list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars)
throws RemoteException
c - 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
RemoteException
<P> List<P> list(Class<? extends P> c,
String cond,
String order,
Object[] bindVars,
int maxRows)
throws RemoteException
c - 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
RemoteException
<P extends Persistent> List<P> list(String classname,
String cond,
String order,
Object[] bindVars)
throws RemoteException
classname - 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
RemoteException
<P> List<P> list2(Class<? extends P> c,
String q,
Object[] bindVars)
throws RemoteException
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..."
c - the class of the objectsq - a SQL querybindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
<P extends Persistent> List<P> list2(String classname,
String q,
Object[] bindVars)
throws RemoteException
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..."
classname - 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
RemoteException
<P> Map<Long,P> table(Class<? extends P> c,
String cond,
Object[] bindVars)
throws RemoteException
c - the class of the objectscond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
<P extends Persistent> Map<Long,P> table(String classname,
String cond,
Object[] bindVars)
throws RemoteException
classname - 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
RemoteException
int count(Class<?> c,
String cond,
Object[] bindVars)
throws RemoteException
c - the classcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
int count(String classname,
String cond,
Object[] bindVars)
throws RemoteException
classname - the name of the classcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
boolean inDatabase(Persistent o)
throws RemoteException
RemoteException
boolean hasRows(String stmt,
Object[] bindVars)
throws RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
RemoteException
<P> P get(Class<? extends P> c,
long oid)
throws RemoteException
c - the class of the objectoid - the oid of the object
RemoteException
<P extends Persistent> P get(String classname,
long oid)
throws RemoteException
classname - the name of the class of the objectoid - the oid of the object
RemoteException
<P> P get(Class<? extends P> c,
String cond)
throws RemoteException
c - the class of the objectcond - a SQL condition
RemoteException
<P extends Persistent> P get(String classname,
String cond)
throws RemoteException
classname - the name of the class of the objectcond - a SQL condition
RemoteException
<P> P get(Class<? extends P> c,
String cond,
Object[] bindVars)
throws RemoteException
c - the class of the objectcond - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
<P extends Persistent> P get(String classname,
String cond,
Object[] bindVars)
throws RemoteException
classname - 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
RemoteException
<P> P fill(P o)
throws RemoteException
o - the object
RemoteException
void insert(Persistent o)
throws RemoteException
o - the object
RemoteException
int update(Persistent o)
throws RemoteException
o - the object
RemoteException
int update(Persistent o,
String... fieldNames)
throws RemoteException
o - the objectfieldNames - an array containing the names of the fields which should be updated
RemoteException
int delete(Persistent o)
throws RemoteException
o - the object to delete
RemoteException
void delete(Class<?> c,
String condition,
Object[] bindVars)
throws RemoteException
Persistent.onDelete() nor PersistentEventHandler.onDelete(Persistent) methods
are called for the individual deleted objects.
c - the class of the objectscondition - a SQL conditionbindVars - if the condition contains place holders for binding variables this array should contain the values
RemoteException
void delete(String classname,
String condition,
Object[] bindVars)
throws RemoteException
Persistent.onDelete() nor PersistentEventHandler.onDelete(Persistent) methods
are called for the individual deleted objects.
classname - 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 values
RemoteException
int executeStatement(String stmt)
throws RemoteException
stmt - the SQL statement text.
RemoteException
int executeStatement(String stmt,
Object[] bindVars)
throws RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
RemoteException
long getOID()
throws RemoteException
RemoteException
Object getValue(String stmt)
throws RemoteException
stmt - the SQL statement text.
RemoteException
Object getValue(String stmt,
int sqlType)
throws RemoteException
stmt - 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.
RemoteException
Object getValue(String stmt,
Object[] bindVars)
throws RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
RemoteException
Object getValue(String stmt,
Object[] bindVars,
int sqlType)
throws RemoteException
stmt - 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.
RemoteException
TableModel getTable(String q,
Object[] bindVars)
throws RemoteException
q - the sql-querybindVars - if the query contains place holders for binding variables this array should contain the values
RemoteException
TableModel getTable(String q,
Object[] bindVars,
int[] sqlTypes)
throws RemoteException
q - 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.
RemoteException
void setSchema(String schema)
throws RemoteException
schema -
RemoteException
String getSchema()
throws RemoteException
RemoteException
<P> P getNoCache(Class<? extends P> c,
long oid)
throws RemoteException
c - the class of the objectoid - the oid of the object
RemoteException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||