|
|||||||||
| 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(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
This method returns the number of members of a given class matching the given condition. |
int |
count(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
This method returns the number of members of a given class matching the given condition. |
void |
delete(java.lang.Class c,
java.lang.String condition,
java.lang.Object[] bindVars)
Deletes some objects from the database. |
void |
delete(Persistent o)
Deletes the object from the database. |
void |
delete(java.lang.String classname,
java.lang.String condition,
java.lang.Object[] bindVars)
Deletes some objects from the database. |
int |
executeStatement(java.lang.String stmt)
Execute a SQL statement. |
int |
executeStatement(java.lang.String stmt,
java.lang.Object[] bindVars)
Execute a SQL statement. |
Persistent |
fill(Persistent o)
Fill objects where only the oid is set. |
Persistent |
get(java.lang.Class c,
long oid)
Method for getting objects from the database. |
Persistent |
get(java.lang.Class c,
java.lang.String cond)
Method for getting objects from the database. |
Persistent |
get(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database. |
Persistent |
get(java.lang.String classname,
long oid)
Method for getting objects from the database. |
Persistent |
get(java.lang.String classname,
java.lang.String cond)
Method for getting objects from the database. |
Persistent |
get(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database. |
Persistent |
getNoCache(java.lang.Class 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 |
java.lang.String |
getSchema()
|
javax.swing.table.TableModel |
getTable(java.lang.String q,
java.lang.Object[] bindVars)
Returns the results of the given query. |
javax.swing.table.TableModel |
getTable(java.lang.String q,
java.lang.Object[] bindVars,
int[] sqlTypes)
Returns the results of the given query. |
java.lang.Object |
getValue(java.lang.String stmt)
Execute a SQL statement which returns one value. |
java.lang.Object |
getValue(java.lang.String stmt,
int sqlType)
Execute a SQL statement which returns one value. |
java.lang.Object |
getValue(java.lang.String stmt,
java.lang.Object[] bindVars)
Execute a SQL statement which returns one value. |
java.lang.Object |
getValue(java.lang.String stmt,
java.lang.Object[] bindVars,
int sqlType)
Execute a SQL statement which returns one value. |
boolean |
hasRows(java.lang.String stmt,
java.lang.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. |
java.util.Vector |
list(java.lang.Class c)
This method returns all members of the given class. |
java.util.Vector |
list(java.lang.Class c,
java.lang.String cond)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list(java.lang.Class c,
java.lang.String cond,
java.lang.String order)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list(java.lang.Class c,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list(java.lang.Class c,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars,
int maxRows)
This method returns the members of the given class matching the given condition and limiting the returned entry count. |
java.util.Vector |
list(java.lang.String classname)
This method returns all members of the given class. |
java.util.Vector |
list(java.lang.String classname,
java.lang.String cond)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list(java.lang.String classname,
java.lang.String cond,
java.lang.String order)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list(java.lang.String classname,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list2(java.lang.Class c,
java.lang.String q,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
java.util.Vector |
list2(java.lang.String classname,
java.lang.String q,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
void |
setSchema(java.lang.String schema)
Set the schema of the tables |
java.util.Hashtable |
table(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
java.util.Hashtable |
table(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
void |
update(Persistent o)
Update the database tuple corresponding to the given object. |
| Method Detail |
|---|
java.util.Vector list(java.lang.Class c)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objects
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.String classname)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the object
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.Class c,
java.lang.String cond)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscond - a SQL conditition
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.String classname,
java.lang.String cond)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectcond - a SQL conditition
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.Class c,
java.lang.String cond,
java.lang.String order)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscond - a SQL condititionorder - a comma separated list of attribute names of the given class.
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.String classname,
java.lang.String cond,
java.lang.String order)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectcond - a SQL condititionorder - a comma separated list of attribute names of the given class.
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.Class c,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscond - a SQL condititionorder - 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
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.Class c,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars,
int maxRows)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscond - a SQL condititionorder - 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
ApplicationException
java.rmi.RemoteException
java.util.Vector list(java.lang.String classname,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectscond - a SQL condititionorder - 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
ApplicationException
java.rmi.RemoteException
java.util.Vector list2(java.lang.Class c,
java.lang.String q,
java.lang.Object[] bindVars)
throws java.rmi.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
java.rmi.RemoteException
java.util.Vector list2(java.lang.String classname,
java.lang.String q,
java.lang.Object[] bindVars)
throws java.rmi.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
java.rmi.RemoteException
java.util.Hashtable table(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
java.util.Hashtable table(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectscond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
int count(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
c - the classcond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
int count(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the classcond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
boolean inDatabase(Persistent o)
throws ApplicationException,
java.rmi.RemoteException
ApplicationException
java.rmi.RemoteException
boolean hasRows(java.lang.String stmt,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.Class c,
long oid)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectoid - the oid of the object
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.String classname,
long oid)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectoid - the oid of the object
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.Class c,
java.lang.String cond)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectcond - a SQL conditition
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.String classname,
java.lang.String cond)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectcond - a SQL conditition
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.Class c,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectcond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
Persistent get(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectcond - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
Persistent fill(Persistent o)
throws ApplicationException,
java.rmi.RemoteException
o - the object
ApplicationException
java.rmi.RemoteException
void insert(Persistent o)
throws ApplicationException,
java.rmi.RemoteException
o - the object
ApplicationException
java.rmi.RemoteException
void update(Persistent o)
throws ApplicationException,
java.rmi.RemoteException
o - the object
ApplicationException
java.rmi.RemoteException
void delete(Persistent o)
throws ApplicationException,
java.rmi.RemoteException
o - the object to delete
ApplicationException
java.rmi.RemoteException
void delete(java.lang.Class c,
java.lang.String condition,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
c - the class of the objectscondition - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
void delete(java.lang.String classname,
java.lang.String condition,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
classname - the name of the class of the objectscondition - a SQL condititionbindVars - if the condition contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
int executeStatement(java.lang.String stmt)
throws ApplicationException,
java.rmi.RemoteException
stmt - the SQL statement text.
ApplicationException
java.rmi.RemoteException
int executeStatement(java.lang.String stmt,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
long getOID()
throws ApplicationException,
java.rmi.RemoteException
ApplicationException
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt)
throws ApplicationException,
java.rmi.RemoteException
stmt - the SQL statement text.
ApplicationException
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt,
int sqlType)
throws ApplicationException,
java.rmi.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.
ApplicationException
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt,
java.lang.Object[] bindVars)
throws ApplicationException,
java.rmi.RemoteException
stmt - the SQL statement text.bindVars - if the stmt contains place holders for binding variables this array should contain the values
ApplicationException
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt,
java.lang.Object[] bindVars,
int sqlType)
throws ApplicationException,
java.rmi.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.
ApplicationException
java.rmi.RemoteException
javax.swing.table.TableModel getTable(java.lang.String q,
java.lang.Object[] bindVars)
throws java.rmi.RemoteException
q - the sql-querybindVars - if the stmt contains place holders for binding variables this array should contain the values
java.rmi.RemoteException
javax.swing.table.TableModel getTable(java.lang.String q,
java.lang.Object[] bindVars,
int[] sqlTypes)
throws java.rmi.RemoteException
q - the sql-querybindVars - if the stmt 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.
java.rmi.RemoteException
void setSchema(java.lang.String schema)
throws java.rmi.RemoteException
schema -
java.rmi.RemoteException
java.lang.String getSchema()
throws java.rmi.RemoteException
java.rmi.RemoteException
Persistent getNoCache(java.lang.Class c,
long oid)
throws java.lang.Exception
c - the class of the objectoid - the oid of the object
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||