|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CpoAdapter
CpoAdapter is an interface for a set of routines that are responsible for Creating, Retrieving, Updating, and Deleting (CRUD) value objects within a datasource. CpoAdapter is an interface that acts as a common facade for different datasources. It is conceivable that an CpoAdapter can be implemented for JDBC, CSV, XML, LDAP, and more datasources producing classes such as JdbcCpoAdapter, CsvCpoAdapter, XmlCpoAdapter, LdapCpoAdapter, etc.
Field Summary | |
---|---|
static int |
CREATE
Static integer to be used with the CpoObject. |
static int |
DELETE
Static integer to be used with the CpoObject. |
static int |
EXECUTE
Static integer to be used with the CpoObject. |
static int |
EXIST
Static integer to be used with the CpoObject. |
static int |
INSERT
Static integer to be used with the CpoObject. |
static int |
LIST
Static integer to be used with the CpoObject. |
static int |
PERSIST
Static integer to be used with the CpoObject. |
static int |
RETRIEVE
Static integer to be used with the CpoObject. |
static int |
UPDATE
Static integer to be used with the CpoObject. |
Method Summary | ||
---|---|---|
void |
clearMetaClass()
Clears the metadata for all classes for the current datasource. |
|
void |
clearMetaClass(boolean all)
Clears the metadata for all classes. |
|
void |
clearMetaClass(java.lang.Object obj)
Clears the metadata for the specified object. |
|
void |
clearMetaClass(java.lang.String className)
Clears the metadata for the specified fully qualifed class name. |
|
|
deleteObject(java.lang.String name,
T obj)
Removes the Object from the datasource. |
|
|
deleteObject(T obj)
Removes the Object from the datasource. |
|
|
deleteObjects(java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
deleteObjects(java.lang.String name,
java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
executeObject(java.lang.String name,
C criteria,
T result)
Executes an Object that represents an executable object within the datasource. |
|
|
executeObject(java.lang.String name,
T object)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
executeObject(T obj)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
existsObject(java.lang.String name,
T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(java.lang.String name,
T obj,
java.util.Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
CpoTrxAdapter |
getCpoTrxAdapter()
Provides a mechanism for the user to obtain a CpoTrxAdapter object. |
|
|
insertObject(java.lang.String name,
T obj)
Creates the Object in the datasource. |
|
|
insertObject(T obj)
Creates the Object in the datasource. |
|
|
insertObjects(java.util.Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
|
insertObjects(java.lang.String name,
java.util.Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending,
java.lang.String function)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoWhere |
newWhere()
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value)
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value,
boolean not)
DOCUMENT ME! |
|
|
persistObject(java.lang.String name,
T obj)
Persists the Object into the datasource. |
|
|
persistObject(T obj)
Persists the Object into the datasource. |
|
|
persistObjects(java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
persistObjects(java.lang.String name,
java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the Object from the datasource. |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries)
Retrieves the Object from the datasource. |
|
|
retrieveObject(java.lang.String name,
T obj)
Retrieves the Object from the datasource. |
|
|
retrieveObject(T obj)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
T result)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
T result,
int queueSize)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
T result)
Retrieves the Object from the datasource. |
|
|
transactObjects(java.util.Collection<CpoObject<T>> coll)
Deprecated. |
|
|
updateObject(java.lang.String name,
T obj)
Update the Object in the datasource. |
|
|
updateObject(T obj)
Update the Object in the datasource. |
|
|
updateObjects(java.util.Collection<T> coll)
Updates a collection of Objects in the datasource. |
|
|
updateObjects(java.lang.String name,
java.util.Collection<T> coll)
Updates a collection of Objects in the datasource. |
Field Detail |
---|
static final int CREATE
CpoObject
,
Constant Field Valuesstatic final int INSERT
CpoObject
,
Constant Field Valuesstatic final int UPDATE
CpoObject
,
Constant Field Valuesstatic final int DELETE
CpoObject
,
Constant Field Valuesstatic final int RETRIEVE
CpoObject
,
Constant Field Valuesstatic final int LIST
CpoObject
,
Constant Field Valuesstatic final int PERSIST
CpoObject
,
Constant Field Valuesstatic final int EXIST
CpoObject
,
Constant Field Valuesstatic final int EXECUTE
CpoObject
,
Constant Field ValuesMethod Detail |
---|
void clearMetaClass(java.lang.Object obj) throws CpoException
obj
- The object whose metadata must be cleared
CpoException
- Thrown if there are errors accessing the datasourcevoid clearMetaClass(java.lang.String className) throws CpoException
className
- The fully qualified class name for the class that needs its
metadata cleared.
CpoException
- Thrown if there are errors accessing the datasourcevoid clearMetaClass(boolean all) throws CpoException
all
- true - clear all classes for all datasources.
false - clear all classes for the current datasource.
CpoException
- Thrown if there are errors accessing the datasourcevoid clearMetaClass() throws CpoException
CpoException
- Thrown if there are errors accessing the datasource<T> long insertObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.insertObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long insertObject(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.insertObject("IDNameInsert",so);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the CREATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used which is
equivalent to insertObject(Object obj);obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long insertObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.insertObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long insertObjects(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.insertObjects("IdNameInsert",al);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the CREATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long deleteObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.deleteObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long deleteObject(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.deleteObject("DeleteById",so);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the DELETE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long deleteObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.deleteObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long deleteObjects(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.deleteObjects("IdNameDelete",al);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the DELETE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> T executeObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.executeObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an Object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to executed the datasource object.
An object of this type will be created and filled with the returned data from the value_object.
This newly created object will be returned from this method.
CpoException
- Thrown if there are errors accessing the datasource<T> T executeObject(java.lang.String name, T object) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.executeObject("execNotifyProc",so);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.object
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to retrieve the collection of objects.
This object defines the object type that will be returned in the collection and
contain the result set data or the OUT Parameters.
CpoException
- DOCUMENT ME!<T,C> T executeObject(java.lang.String name, C criteria, T result) throws CpoException
Example:
class SomeObject so = new SomeObject();
class SomeResult sr = new SomeResult();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
sr = (SomeResult)cpo.executeObject("execNotifyProc",so, sr);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the EXECUTE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object defines the
object type that will be created, filled with the return data and returned from this
method.
CpoException
- Thrown if there are errors accessing the datasource<T> long existsObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
count = cpo.existsObject(so);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. This object will be searched for inside the
datasource.
CpoException
- Thrown if there are errors accessing the datasource<T> long existsObject(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
count = cpo.existsObject("SomeExistCheck",so);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the EXISTS Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. This object will be searched for inside the
datasource.
CpoException
- Thrown if there are errors accessing the datasource<T> long existsObject(java.lang.String name, T obj, java.util.Collection<CpoWhere> wheres) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
CpoWhere where = cpo.newCpoWhere(CpoWhere.LOGIC_NONE, id, CpoWhere.COMP_EQ);
count = cpo.existsObject("SomeExistCheck",so, where);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the EXISTS Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. This object will be searched for inside the
datasource.wheres
- A collection of CpoWhere objects that pass in run-time constraints to the query that performs the
the exist
CpoException
- Thrown if there are errors accessing the datasourceCpoOrderBy newOrderBy(java.lang.String attribute, boolean ascending) throws CpoException
attribute
- The name of the attribute from the pojo that will be sorted.ascending
- If true, sort ascending. If false sort descending.
CpoException
- Thrown if there are errors accessing the datasourceCpoOrderBy newOrderBy(java.lang.String attribute, boolean ascending, java.lang.String function) throws CpoException
attribute
- The name of the attribute from the pojo that will be sorted.ascending
- If true, sort ascending. If false sort descending.function
- A string which represents a datasource function that will be called on the attribute.
must be contained in the function string. The attribute name will be replaced at run-time with its
datasource counterpart
CpoException
- Thrown if there are errors accessing the datasourceCpoWhere newWhere() throws CpoException
CpoException
- Thrown if there are errors accessing the datasource<T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value) throws CpoException
logical
- DOCUMENT ME!attr
- DOCUMENT ME!comp
- DOCUMENT ME!value
- DOCUMENT ME!
CpoException
- Thrown if there are errors accessing the datasource<T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value, boolean not) throws CpoException
logical
- DOCUMENT ME!attr
- DOCUMENT ME!comp
- DOCUMENT ME!value
- DOCUMENT ME!not
- DOCUMENT ME!
CpoException
- Thrown if there are errors accessing the datasource<T> long persistObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.persistObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
<T> long persistObject(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.persistObject("persistSomeObject",so);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups to
execute to persist the object.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
<T> long persistObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.persistObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
<T> long persistObjects(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.persistObjects("myPersist",al);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups to
execute to persist the object.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
<T> T retrieveObject(T obj) throws CpoException
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource, an exception will be thrown. The input object is used to specify
the search criteria, the output object is populated with the results of the query.
CpoException
- Thrown if there are errors accessing the datasource<T> T retrieveObject(java.lang.String name, T obj) throws CpoException
name
- DOCUMENT ME!obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource, an exception will be thrown. The input object is used to specify
the search criteria, the output object is populated with the results of the query.
CpoException
- Thrown if there are errors accessing the datasource<T,C> T retrieveObject(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returned
CpoException
- Thrown if there are errors accessing the datasource<T,C> T retrieveObject(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries) throws CpoException
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasource<T,C> java.util.Collection<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, T result) throws CpoException
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returned
CpoException
- Thrown if there are errors accessing the datasource<T,C> java.util.Collection<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, T result) throws CpoException
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasource<T,C> CpoResultSet<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, T result, int queueSize) throws CpoException
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-timethe
- queue size of the buffer that it uses to send the objects from the producer to the
consumer.
CpoException
- Thrown if there are errors accessing the datasource@Deprecated <T> long transactObjects(java.util.Collection<CpoObject<T>> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
CpoObject cobj = new CpoObject(CpoAdapter.CREATE,"MyCreate",so);
al.add(cobj);
so = new SomeObject();
so.setId(3);
so.setName("New Name");
CpoObject cobj = new CpoObject(CpoAdapter.PERSIST,"MyPersist",so);
al.add(cobj);
try{
cpo.transactObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
coll
- This is a collection of CpoObject objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long updateObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.updateObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long updateObject(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.updateObject("updateSomeObject",so);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the UPDATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long updateObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.updateObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource<T> long updateObjects(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.updateObjects("myUpdate",al);
} catch (CpoException ce) {
// Handle the error
}
}
name
- The String name of the UPDATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceCpoTrxAdapter getCpoTrxAdapter() throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
class CpoTrxAdapter cpoTrx = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
cpoTrx = cpo.getCpoTrxAdapter();
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
try{
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
cpo.updateObject("myUpdate",so);
}
cpoTrx.commit();
} catch (CpoException ce) {
// Handle the error
cpoTrx.rollback();
}
}
CpoException
- Thrown if there are errors accessing the datasourceCpoTrxAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |