|
|||||||||
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(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. |
|
int |
delete(java.lang.Class<?> c,
java.lang.String condition,
java.lang.Object[] bindVars)
Deletes some objects from the database. |
|
int |
delete(Persistent o)
Deletes the object from the database. |
|
int |
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. |
|
|
fill(P o)
Fill objects where only the oid is set. |
|
|
fillByField(java.lang.Class<? extends P> c,
java.util.Collection<R> collection,
java.lang.String fieldname)
Fill a heterogeneous set of Persistents referenced via a field of a collection of (persistent) objects. |
|
|
fillByField(java.lang.Class<? extends P> c,
java.util.Collection<R> collection,
java.lang.String fieldname,
java.lang.String cond,
java.lang.Object[] bindVars)
Fill a heterogeneous set of Persistents referenced via a field of a collection of (persistent) objects. |
|
|
get(java.lang.Class<? extends P> c,
long oid)
Method for getting objects from the database. |
|
|
get(java.lang.Class<? extends P> c,
java.lang.String cond)
Method for getting objects from the database. |
|
|
get(java.lang.Class<? extends P> c,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database. |
|
|
get(java.lang.String classname,
long oid)
Method for getting objects from the database. |
|
|
get(java.lang.String classname,
java.lang.String cond)
Method for getting objects from the database. |
|
|
get(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database. |
|
|
getNoCache(java.lang.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 |
|
java.lang.String |
getSchema()
Returns the schema of the tables |
|
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. |
|
|
list(java.lang.Class<? extends P> c)
This method returns all members of the given class. |
|
|
list(java.lang.Class<? extends P> c,
java.lang.String cond)
This method returns the members of the given class matching the given condition. |
|
|
list(java.lang.Class<? extends P> c,
java.lang.String cond,
java.lang.String order)
This method returns the members of the given class matching the given condition. |
|
|
list(java.lang.Class<? extends P> 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. |
|
|
list(java.lang.Class<? extends P> 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. |
|
|
list(java.lang.String classname)
This method returns all members of the given class. |
|
|
list(java.lang.String classname,
java.lang.String cond)
This method returns the members of the given class matching the given condition. |
|
|
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. |
|
|
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. |
|
|
list2(java.lang.Class<? extends P> c,
java.lang.String q,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
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 |
|
|
table(java.lang.Class<? extends P> c,
java.lang.String cond,
java.lang.Object[] bindVars)
This method returns the members of the given class matching the given condition. |
|
|
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. |
|
int |
update(Persistent o)
Update the database tuple corresponding to the given object. |
|
int |
update(Persistent o,
java.lang.String... fieldNames)
Update some fields of the database tuple corresponding to the given object. |
Method Detail |
---|
<P> java.util.List<P> list(java.lang.Class<? extends P> c) throws java.rmi.RemoteException
c
- the class of the objects
java.rmi.RemoteException
<P extends Persistent> java.util.List<P> list(java.lang.String classname) throws java.rmi.RemoteException
classname
- the name of the class of the object
java.rmi.RemoteException
<P> java.util.List<P> list(java.lang.Class<? extends P> c, java.lang.String cond) throws java.rmi.RemoteException
c
- the class of the objectscond
- a SQL condition
java.rmi.RemoteException
<P extends Persistent> java.util.List<P> list(java.lang.String classname, java.lang.String cond) throws java.rmi.RemoteException
classname
- the name of the class of the objectcond
- a SQL condition
java.rmi.RemoteException
<P> java.util.List<P> list(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.String order) throws java.rmi.RemoteException
c
- the class of the objectscond
- a SQL conditionorder
- a comma separated list of attribute names of the given class.
java.rmi.RemoteException
<P extends Persistent> java.util.List<P> list(java.lang.String classname, java.lang.String cond, java.lang.String order) throws java.rmi.RemoteException
classname
- the name of the class of the objectcond
- a SQL conditionorder
- a comma separated list of attribute names of the given class.
java.rmi.RemoteException
<P> java.util.List<P> list(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
<P> java.util.List<P> list(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars, int maxRows) throws java.rmi.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
java.rmi.RemoteException
<P extends Persistent> java.util.List<P> list(java.lang.String classname, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
<P> java.util.List<P> list2(java.lang.Class<? extends P> 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
<P extends Persistent> java.util.List<P> 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
<P> java.util.Map<java.lang.Long,P> table(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
<P extends Persistent> java.util.Map<java.lang.Long,P> table(java.lang.String classname, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
int count(java.lang.Class<?> c, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.RemoteException
c
- the classcond
- a SQL conditionbindVars
- if the condition contains place holders for binding variables this array should contain the values
java.rmi.RemoteException
int count(java.lang.String classname, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
boolean inDatabase(Persistent o) throws java.rmi.RemoteException
java.rmi.RemoteException
boolean hasRows(java.lang.String stmt, java.lang.Object[] bindVars) throws java.rmi.RemoteException
stmt
- the SQL statement text.bindVars
- if the stmt contains place holders for binding variables this array should contain the values
java.rmi.RemoteException
<P> P get(java.lang.Class<? extends P> c, long oid) throws java.rmi.RemoteException
c
- the class of the objectoid
- the oid of the object
java.rmi.RemoteException
<P extends Persistent> P get(java.lang.String classname, long oid) throws java.rmi.RemoteException
classname
- the name of the class of the objectoid
- the oid of the object
java.rmi.RemoteException
<P> P get(java.lang.Class<? extends P> c, java.lang.String cond) throws java.rmi.RemoteException
c
- the class of the objectcond
- a SQL condition
java.rmi.RemoteException
<P extends Persistent> P get(java.lang.String classname, java.lang.String cond) throws java.rmi.RemoteException
classname
- the name of the class of the objectcond
- a SQL condition
java.rmi.RemoteException
<P> P get(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
<P extends Persistent> P get(java.lang.String classname, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
<P> P fill(P o) throws java.rmi.RemoteException
o
- the object
java.rmi.RemoteException
<P extends Persistent,R extends Persistent> java.util.Set<P> fillByField(java.lang.Class<? extends P> c, java.util.Collection<R> collection, java.lang.String fieldname) throws java.rmi.RemoteException
c
- (super)class of the referenced Objectscollection
- the Collection of referencing objects, must all be filled.fieldName
- the name of the referencing field. Must be a Persistent
.
java.rmi.RemoteException
<P extends Persistent,R extends Persistent> java.util.Set<P> fillByField(java.lang.Class<? extends P> c, java.util.Collection<R> collection, java.lang.String fieldname, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.RemoteException
c
- (super)class of the referenced Objectscollection
- the Collection of referencing objects, must all be filled.fieldName
- the name of the referencing field. Must be a Persistent
.cond
- an optional SQL condition.bindVars
- optional array of parameter bindings for the SQL statement.
java.rmi.RemoteException
void insert(Persistent o) throws java.rmi.RemoteException
o
- the object
java.rmi.RemoteException
int update(Persistent o) throws java.rmi.RemoteException
o
- the object
java.rmi.RemoteException
int update(Persistent o, java.lang.String... fieldNames) throws java.rmi.RemoteException
o
- the objectfieldNames
- an array containing the names of the fields which should be updated
java.rmi.RemoteException
int delete(Persistent o) throws java.rmi.RemoteException
o
- the object to delete
java.rmi.RemoteException
int delete(java.lang.Class<?> c, java.lang.String condition, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
int delete(java.lang.String classname, java.lang.String condition, java.lang.Object[] bindVars) throws java.rmi.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
java.rmi.RemoteException
int executeStatement(java.lang.String stmt) throws java.rmi.RemoteException
stmt
- the SQL statement text.
java.rmi.RemoteException
int executeStatement(java.lang.String stmt, java.lang.Object[] bindVars) throws java.rmi.RemoteException
stmt
- the SQL statement text.bindVars
- if the stmt contains place holders for binding variables this array should contain the values
java.rmi.RemoteException
long getOID() throws java.rmi.RemoteException
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt) throws java.rmi.RemoteException
stmt
- the SQL statement text.
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt, int sqlType) throws 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.
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt, java.lang.Object[] bindVars) throws java.rmi.RemoteException
stmt
- the SQL statement text.bindVars
- if the stmt contains place holders for binding variables this array should contain the values
java.rmi.RemoteException
java.lang.Object getValue(java.lang.String stmt, java.lang.Object[] bindVars, int sqlType) throws 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.
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 query 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 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.
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
<P> P getNoCache(java.lang.Class<? extends P> c, long oid) throws java.rmi.RemoteException
c
- the class of the objectoid
- the oid of the object
java.rmi.RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |