public interface RemoteStore
extends java.rmi.Remote
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.
Modifier and Type | Method and Description |
---|---|
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(java.util.Collection<?> collection)
Deletes the objects of the collection 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.
|
<P extends Persistent> |
fill(java.util.List<P> l)
Fills the objects within list l.
|
<P> P |
fill(P o)
Fill objects where only the oid is set.
|
<P extends Persistent,R extends Persistent> |
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.
|
<P extends Persistent,R extends Persistent> |
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.
|
<P extends Persistent> |
fillByFields(java.util.Collection<P> collection,
java.lang.String fieldNames)
Fetches dependent objects of a collection of Persistents reachable via the specified fields.
|
<P> P |
get(java.lang.Class<? extends P> c,
long oid)
Method for getting objects from the database.
|
<P> P |
get(java.lang.Class<? extends P> c,
java.lang.String cond)
Method for getting objects from the database.
|
<P> P |
get(java.lang.Class<? extends P> c,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database.
|
<P extends Persistent> |
get(java.lang.String classname,
long oid)
Method for getting objects from the database.
|
<P extends Persistent> |
get(java.lang.String classname,
java.lang.String cond)
Method for getting objects from the database.
|
<P extends Persistent> |
get(java.lang.String classname,
java.lang.String cond,
java.lang.Object[] bindVars)
Method for getting objects from the database.
|
<P> P |
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)
Deprecated.
since ep90 use
getTable(String, Object[], int[]) with explicit type information instead |
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(java.util.Collection<?> collection)
Insert the objects of the collection into the database.
|
void |
insert(Persistent o)
Insert the object into the database.
|
<P> java.util.List<P> |
list(java.lang.Class<? extends P> c)
This method returns all members of the given class.
|
<P> java.util.List<P> |
list(java.lang.Class<? extends P> c,
java.lang.String cond)
This method returns the members of the given class matching the given condition.
|
<P> java.util.List<P> |
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.
|
<P> java.util.List<P> |
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.
|
<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)
This method returns the members of the given class matching the given condition
and limiting the returned entry count.
|
<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,
int offset)
This method returns the members of the given class matching the given condition
and limiting the returned entry count.
|
<P extends Persistent> |
list(java.lang.String classname)
This method returns all members of the given class.
|
<P extends Persistent> |
list(java.lang.String classname,
java.lang.String cond)
This method returns the members of the given class matching the given condition.
|
<P extends Persistent> |
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.
|
<P extends Persistent> |
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.
|
<P> java.util.List<P> |
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.
|
<P extends Persistent> |
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.
|
<P> java.util.Set<P> |
setOf(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 as a
Set . |
<P extends Persistent> |
setOf(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 as a
Set . |
void |
setSchema(java.lang.String schema)
Set the schema of the tables
|
<P> java.util.Map<java.lang.Long,P> |
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 as a
Map . |
<P extends Persistent> |
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 as a
Map . |
int |
update(java.util.Collection<?> collection)
Updates the objects of the collection in the database.
|
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.
|
<P> java.util.List<P> list(java.lang.Class<? extends P> c) throws java.rmi.RemoteException
c
- the class of the objectsjava.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 objectjava.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 conditionjava.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 conditionjava.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 valuesjava.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 returnjava.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, int offset) 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 returnoffset
- number of rows to skip from the beginningjava.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 valuesjava.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 avw_user 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 valuesjava.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 avw_user 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 valuesjava.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
Map
.
The keys of the map are the oids of the objects as Long objects, the values are the objects itself.c
- the class of the objectscond
- a SQL conditionbindVars
- if the condition contains place holders for binding variables this array should contain the valuesjava.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
Map
.
The keys of the table are the oids of the objects as Long objects, the values are the objects itself.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 valuesjava.rmi.RemoteException
<P> java.util.Set<P> setOf(java.lang.Class<? extends P> c, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.RemoteException
Set
.
The the values are the objects itself.c
- the class of the objectscond
- a SQL conditionbindVars
- if the condition contains place holders for binding variables this array should contain the valuesjava.rmi.RemoteException
<P extends Persistent> java.util.Set<P> setOf(java.lang.String classname, java.lang.String cond, java.lang.Object[] bindVars) throws java.rmi.RemoteException
Set
.
The keys of the table are the oids of the objects as Long objects, the values are the objects itself.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 valuesjava.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 valuesjava.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 valuesjava.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 valuesjava.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 objectjava.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 objectjava.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 conditionjava.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 conditionjava.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 valuesjava.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 valuesjava.rmi.RemoteException
<P> P fill(P o) throws java.rmi.RemoteException
o
- the objectjava.rmi.RemoteException
<P extends Persistent> java.util.List<P> fill(java.util.List<P> l) throws java.rmi.RemoteException
l
- the list of objects to be filledjava.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
<P extends Persistent> void fillByFields(java.util.Collection<P> collection, java.lang.String fieldNames) throws java.rmi.RemoteException
collection
- the Collection of referencing objects, must all be filled.fieldNames
- a comma separated string of field names. Every field name must denote a Persistent
field.java.rmi.RemoteException
void insert(Persistent o) throws java.rmi.RemoteException
o
- the objectjava.rmi.RemoteException
void insert(java.util.Collection<?> collection) throws java.rmi.RemoteException
collection
- the objects to insert (all of the objects must implement Persistent)java.rmi.RemoteException
int update(Persistent o) throws java.rmi.RemoteException
o
- the objectjava.rmi.RemoteException
int update(java.util.Collection<?> collection) throws java.rmi.RemoteException
collection
- the objects to update (all of the objects must implement Persistent)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 updatedjava.rmi.RemoteException
int delete(Persistent o) throws java.rmi.RemoteException
o
- the object to deletejava.rmi.RemoteException
int delete(java.util.Collection<?> collection) throws java.rmi.RemoteException
collection
- the objects to delete (all of the objects must implement Persistent)java.rmi.RemoteException
int delete(java.lang.Class<?> c, java.lang.String condition, java.lang.Object[] bindVars) throws java.rmi.RemoteException
Persistent.beforeDelete()
nor PersistentEventHandler.beforeDelete(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 valuesjava.rmi.RemoteException
int delete(java.lang.String classname, java.lang.String condition, java.lang.Object[] bindVars) throws java.rmi.RemoteException
Persistent.beforeDelete()
nor PersistentEventHandler.beforeDelete(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 valuesjava.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 valuesjava.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 valuesjava.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
@Deprecated javax.swing.table.TableModel getTable(java.lang.String q, java.lang.Object[] bindVars) throws java.rmi.RemoteException
getTable(String, Object[], int[])
with explicit type information insteadq
- the sql-querybindVars
- if the query contains place holders for binding variables this array should contain the valuesjava.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 objectjava.rmi.RemoteException
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.