public class JdbcCpoXaAdapter extends CpoBaseXaResource<JdbcCpoAdapter> implements CpoTrxAdapter
The XAResource interface is a Java mapping of the industry standard XA interface based on the X/Open CAE Specification (Distributed Transaction Processing: The XA Specification).
The XA interface defines the contract between a Resource Manager and a Transaction Manager in a distributed transaction processing (DTP) environment. A JDBC driver or a JMS provider implements this interface to support the association between a global transaction and a database or message service connection.
The XAResource interface can be supported by any transactional resource that is intended to be used by application programs in an environment where transactions are controlled by an external transaction manager. An example of such a resource is a database management system. An application may access data through multiple database connections. Each database connection is enlisted with the transaction manager as a transactional resource. The transaction manager obtains an XAResource for each connection participating in a global transaction. The transaction manager uses the start method to associate the global transaction with the resource, and it uses the end method to disassociate the transaction from the resource. The resource manager is responsible for associating the global transaction to all work performed on its data between the start and end method invocations.
At transaction commit time, the resource managers are informed by the transaction manager to prepare, commit, or rollback a transaction according to the two-phase commit protocol.
CpoXaResource.CpoXaErrorCREATE, CREATE_GROUP, DELETE, DELETE_GROUP, EXECUTE, EXECUTE_GROUP, EXIST, EXIST_GROUP, GROUP_IDS, INSERT, LIST, LIST_GROUP, PERSIST, PERSIST_GROUP, RETRIEVE, RETRIEVE_GROUP, UPDATE, UPDATE_GROUPTMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY| Constructor and Description |
|---|
JdbcCpoXaAdapter(JdbcCpoAdapterFactory jdbcCpoAdapterFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the current transaction behind the CpoTrxAdapter.
|
void |
closeResource(JdbcCpoAdapter jdbcCpoAdapter) |
void |
commit()
Commits the current transaction behind the CpoTrxAdapter
|
void |
commitResource(JdbcCpoAdapter jdbcCpoAdapter) |
JdbcCpoTrxAdapter |
createNewResource() |
<T> long |
deleteObject(String name,
T obj)
Removes the Object from the datasource.
|
<T> long |
deleteObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Removes the Object from the datasource.
|
<T> long |
deleteObject(T obj)
Removes the Object from the datasource.
|
<T> long |
deleteObjects(Collection<T> coll)
Removes the Objects contained in the collection from the datasource.
|
<T> long |
deleteObjects(String name,
Collection<T> coll)
Removes the Objects contained in the collection from the datasource.
|
<T> long |
deleteObjects(String name,
Collection<T> coll,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Removes the Objects contained in the collection from the datasource.
|
<T,C> T |
executeObject(String name,
C criteria,
T result)
Executes an Object that represents an executable object within the datasource.
|
<T> T |
executeObject(String name,
T object)
Executes an Object whose metadata will call an executable within the datasource.
|
<T> T |
executeObject(T obj)
Executes an Object whose metadata will call an executable within the datasource.
|
<T> long |
existsObject(String name,
T obj)
The CpoAdapter will check to see if this object exists in the datasource.
|
<T> long |
existsObject(String name,
T obj,
Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource.
|
<T> long |
existsObject(T obj)
The CpoAdapter will check to see if this object exists in the datasource.
|
List<CpoAttribute> |
getCpoAttributes(String expression) |
CpoMetaDescriptor |
getCpoMetaDescriptor() |
String |
getDataSourceName() |
<T> long |
insertObject(String name,
T obj)
Creates the Object in the datasource.
|
<T> long |
insertObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Creates the Object in the datasource.
|
<T> long |
insertObject(T obj)
Creates the Object in the datasource.
|
<T> long |
insertObjects(Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource.
|
<T> long |
insertObjects(String name,
Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource.
|
<T> long |
insertObjects(String name,
Collection<T> coll,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Iterates through a collection of Objects, creates and stores them in the datasource.
|
boolean |
isBusy()
Returns true if the TrxAdapter is processing a request, false if it is not
|
boolean |
isClosed()
Returns true if the TrxAdapter has been closed, false if it is still active
|
boolean |
isLocalResourceBusy() |
boolean |
isSameRM(XAResource xaResource)
This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager
instance represented by the parameter xares.
|
CpoOrderBy |
newOrderBy(String attribute,
boolean ascending)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection.
|
CpoOrderBy |
newOrderBy(String attribute,
boolean ascending,
String function)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection.
|
CpoOrderBy |
newOrderBy(String marker,
String attribute,
boolean ascending)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection.
|
CpoOrderBy |
newOrderBy(String marker,
String attribute,
boolean ascending,
String function)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection.
|
CpoWhere |
newWhere()
DOCUMENT ME!
|
<T> CpoWhere |
newWhere(int logical,
String attr,
int comp,
T value)
DOCUMENT ME!
|
<T> CpoWhere |
newWhere(int logical,
String attr,
int comp,
T value,
boolean not)
DOCUMENT ME!
|
<T> long |
persistObject(String name,
T bean)
Persists the Object into the datasource.
|
<T> long |
persistObject(T bean)
Persists the Object into the datasource.
|
<T> long |
persistObjects(Collection<T> coll)
Persists a collection of Objects into the datasource.
|
<T> long |
persistObjects(String name,
Collection<T> coll)
Persists a collection of Objects into the datasource.
|
protected void |
prepareResource(JdbcCpoAdapter jdbcCpoAdapter) |
<T,C> T |
retrieveBean(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
<T,C> T |
retrieveBean(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource.
|
<T> T |
retrieveBean(String name,
T bean)
Retrieves the bean from the datasource.
|
<T> T |
retrieveBean(String name,
T bean,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource.
|
<T> T |
retrieveBean(T bean)
Retrieves the Bean from the datasource.
|
<C> List<C> |
retrieveBeans(String name,
C criteria)
Retrieves the bean from the datasource.
|
<C> List<C> |
retrieveBeans(String name,
C criteria,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
<C> List<C> |
retrieveBeans(String name,
C criteria,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
<C> List<C> |
retrieveBeans(String name,
C criteria,
CpoWhere where,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
<T,C> List<T> |
retrieveBeans(String name,
C criteria,
T result)
Retrieves the bean from the datasource.
|
<T,C> List<T> |
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
<T,C> List<T> |
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource.
|
<T,C> CpoResultSet<T> |
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
int queueSize)
Retrieves the bean from the datasource.
|
<T,C> List<T> |
retrieveBeans(String name,
C criteria,
T result,
CpoWhere where,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource.
|
void |
rollback()
Rollback the current transaction behind the CpoTrxAdapter
|
void |
rollbackResource(JdbcCpoAdapter jdbcCpoAdapter) |
<T> long |
updateObject(String name,
T obj)
Update the Object in the datasource.
|
<T> long |
updateObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Update the Object in the datasource.
|
<T> long |
updateObject(T obj)
Update the Object in the datasource.
|
<T> long |
updateObjects(Collection<T> coll)
Updates a collection of Objects in the datasource.
|
<T> long |
updateObjects(String name,
Collection<T> coll)
Updates a collection of Objects in the datasource.
|
<T> long |
updateObjects(String name,
Collection<T> coll,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Updates a collection of Objects in the datasource.
|
close, closeAssociated, commit, end, forget, getCurrentResource, getLocalResource, getTransactionTimeout, prepare, recover, rollback, setTransactionTimeout, startpublic JdbcCpoXaAdapter(JdbcCpoAdapterFactory jdbcCpoAdapterFactory) throws CpoException
CpoExceptionpublic void commit()
throws CpoException
commit in interface CpoTrxAdapterCpoExceptionpublic void rollback()
throws CpoException
rollback in interface CpoTrxAdapterCpoExceptionpublic void close()
throws CpoException
close in interface AutoCloseableclose in interface CpoTrxAdapterCpoExceptionpublic boolean isClosed()
throws CpoException
isClosed in interface CpoTrxAdapterCpoExceptionpublic boolean isBusy()
throws CpoException
isBusy in interface CpoTrxAdapterCpoExceptionpublic <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
}
}
insertObject in interface CpoAdapterobj - 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 datasourcepublic <T> long insertObject(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
}
}
insertObject in interface CpoAdaptername - The String name of the CREATE Function 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 datasourcepublic <T> long insertObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) 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
}
}
insertObject in interface CpoAdaptername - The String name of the CREATE Function 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.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <T> long insertObjects(Collection<T> coll) throws CpoException
This method creates and stores the objects in the datasource. The objects in the collection will be treated as one transaction, assuming the datasource supports transactions.
This means that if one of the objects fail being created in the datasource then the CpoAdapter will stop processing the remainder of the collection and rollback all the objects created thus far. Rollback is on the underlying datasource's support of rollback.
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
}
}
insertObjects in interface CpoAdaptercoll - 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 datasourcepublic <T> long insertObjects(String name, Collection<T> coll) throws CpoException
This method creates and stores the objects in the datasource. The objects in the collection will be treated as one transaction, assuming the datasource supports transactions.
This means that if one of the objects fail being created in the datasource then the CpoAdapter should stop processing the remainder of the collection, and if supported, rollback all the objects created thus far.
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
}
}
insertObjects in interface CpoAdaptername - The String name of the CREATE Function 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 datasourcepublic <T> long insertObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
This method creates and stores the objects in the datasource. The objects in the collection will be treated as one transaction, assuming the datasource supports transactions.
This means that if one of the objects fail being created in the datasource then the CpoAdapter should stop processing the remainder of the collection, and if supported, rollback all the objects created thus far.
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
}
}
insertObjects in interface CpoAdaptername - The String name of the CREATE Function 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.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <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
}
}
deleteObject in interface CpoAdapterobj - 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 datasourcepublic <T> long deleteObject(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
}
}
deleteObject in interface CpoAdaptername - The String name of the DELETE Function 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 datasourcepublic <T> long deleteObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) 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
}
}
deleteObject in interface CpoAdaptername - The String name of the DELETE Function 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.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <T> long deleteObjects(Collection<T> coll) throws CpoException
This means that if one of the objects fail being deleted in the datasource then the CpoAdapter should stop processing the remainder of the collection, and if supported, rollback all the objects deleted thus far.
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
}
}
deleteObjects in interface CpoAdaptercoll - 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 datasourcepublic <T> long deleteObjects(String name, Collection<T> coll) throws CpoException
This means that if one of the objects fail being deleted in the datasource then the CpoAdapter should stop processing the remainder of the collection, and if supported, rollback all the objects deleted thus far.
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
}
}
deleteObjects in interface CpoAdaptername - The String name of the DELETE Function 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 datasourcepublic <T> long deleteObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
This means that if one of the objects fail being deleted in the datasource then the CpoAdapter should stop processing the remainder of the collection, and if supported, rollback all the objects deleted thus far.
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
}
}
deleteObjects in interface CpoAdaptername - The String name of the DELETE Function 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.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <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
}
}
executeObject in interface CpoAdapterobj - 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 datasourcepublic <T> T executeObject(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
}
}
executeObject in interface CpoAdaptername - 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!public <T,C> T executeObject(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
}
}
executeObject in interface CpoAdaptername - The String name of the EXECUTE Function 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 datasourcepublic <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
}
}
existsObject in interface CpoAdapterobj - 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 datasourcepublic <T> long existsObject(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
}
}
existsObject in interface CpoAdaptername - The String name of the EXISTS Function 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 datasourcepublic <T> long existsObject(String name, T obj, 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
}
}
existsObject in interface CpoAdaptername - The String name of the EXISTS Function 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 function that performs the the
existCpoException - Thrown if there are errors accessing the datasourcepublic CpoOrderBy newOrderBy(String attribute, boolean ascending) throws CpoException
newOrderBy in interface CpoAdapterattribute - 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 datasourcepublic CpoOrderBy newOrderBy(String marker, String attribute, boolean ascending) throws CpoException
newOrderBy in interface CpoAdaptermarker - the marker that will be replaced in the expression with the string representation of this orderByattribute - 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 datasourcepublic CpoOrderBy newOrderBy(String attribute, boolean ascending, String function) throws CpoException
newOrderBy in interface CpoAdapterattribute - 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 counterpartCpoException - Thrown if there are errors accessing the datasourcepublic CpoOrderBy newOrderBy(String marker, String attribute, boolean ascending, String function) throws CpoException
newOrderBy in interface CpoAdaptermarker - the marker that will be replaced in the expression with the string representation of this orderByattribute - 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 counterpartCpoException - Thrown if there are errors accessing the datasourcepublic CpoWhere newWhere() throws CpoException
newWhere in interface CpoAdapterCpoException - Thrown if there are errors accessing the datasourcepublic <T> CpoWhere newWhere(int logical, String attr, int comp, T value) throws CpoException
newWhere in interface CpoAdapterlogical - DOCUMENT ME!attr - DOCUMENT ME!comp - DOCUMENT ME!value - DOCUMENT ME!CpoException - Thrown if there are errors accessing the datasourcepublic <T> CpoWhere newWhere(int logical, String attr, int comp, T value, boolean not) throws CpoException
newWhere in interface CpoAdapterlogical - DOCUMENT ME!attr - DOCUMENT ME!comp - DOCUMENT ME!value - DOCUMENT ME!not - DOCUMENT ME!CpoException - Thrown if there are errors accessing the datasourcepublic <T> long persistObject(T bean)
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
}
}
persistObject in interface CpoAdapterbean - This is a bean 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)public <T> long persistObject(String name, T bean) 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
}
}
persistObject in interface CpoAdaptername - The name which identifies which EXISTS, INSERT, and UPDATE Function Groups to execute to persist the
object.bean - This is a bean 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)public <T> long persistObjects(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
}
}
persistObjects in interface CpoAdaptercoll - 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)public <T> long persistObjects(String name, 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
}
}
persistObjects in interface CpoAdaptername - The name which identifies which EXISTS, INSERT, and UPDATE Function 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)public <T> T retrieveBean(T bean)
throws CpoException
retrieveBean in interface CpoAdapterbean - This is a bean that has been defined within the metadata of the datasource. If the class is not defined
an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown. The input
bean is used to specify the search criteria, the output bean is populated with the results of the function.CpoException - Thrown if there are errors accessing the datasourcepublic <T> T retrieveBean(String name, T bean) throws CpoException
retrieveBean in interface CpoAdaptername - DOCUMENT ME!bean - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown. The
input bean is used to specify the search criteria, the output bean is populated with the results of the function.CpoException - Thrown if there are errors accessing the datasourcepublic <T> T retrieveBean(String name, T bean, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
retrieveBean in interface CpoAdaptername - DOCUMENT ME!bean - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown. The
input bean is used to specify the search criteria, the output bean is populated with the results of the function.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> T retrieveBean(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBean in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> T retrieveBean(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
retrieveBean in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <C> List<C> retrieveBeans(String name, C criteria) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.CpoException - Thrown if there are errors accessing the datasourcepublic <C> List<C> retrieveBeans(String name, C criteria, CpoWhere where, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.where - A CpoWhere bean that defines the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <C> List<C> retrieveBeans(String name, C criteria, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.orderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <C> List<C> retrieveBeans(String name, C criteria, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> List<T> retrieveBeans(String name, C criteria, T result) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.CpoException - Thrown if there are errors accessing the datasourcepublic <T,C> List<T> retrieveBeans(String name, C criteria, T result, CpoWhere where, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.where - A CpoWhere bean that defines the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> List<T> retrieveBeans(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnedCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> List<T> retrieveBeans(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timeCpoException - Thrown if there are errors accessing the datasourcepublic <T,C> CpoResultSet<T> retrieveBeans(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, int queueSize) throws CpoException
retrieveBeans in interface CpoAdaptername - The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.criteria - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the parameters used to retrieve the collection of beans.result - This is an bean that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the bean does not exist in the datasource, an exception will be thrown.
This bean is used to specify the bean type that will be returned in the collection.wheres - A collection of CpoWhere beans that define the constraints that should be used when retrieving beansorderBy - The CpoOrderBy bean that defines the order in which beans should be returnednativeExpressions - Native expression that will be used to augment the expression stored in the meta data. This
text will be embedded at run-timequeueSize - queue size of the buffer that it uses to send the beans from the producer to the consumer.CpoException - Thrown if there are errors accessing the datasourcepublic <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
}
}
updateObject in interface CpoAdapterobj - 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 datasourcepublic <T> long updateObject(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
}
}
updateObject in interface CpoAdaptername - The String name of the UPDATE Function 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 datasourcepublic <T> long updateObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) 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
}
}
updateObject in interface CpoAdaptername - The String name of the UPDATE Function 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.wheres - A collection of CpoWhere objects to be used by the functionorderBy - A collection of CpoOrderBy objects to be used by the functionnativeExpressions - A collection of CpoNativeFunction objects to be used by the functionCpoException - Thrown if there are errors accessing the datasourcepublic <T> long updateObjects(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
}
}
updateObjects in interface CpoAdaptercoll - 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 datasourcepublic <T> long updateObjects(String name, 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
}
}
updateObjects in interface CpoAdaptername - The String name of the UPDATE Function 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 datasourcepublic <T> long updateObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) 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
}
}
updateObjects in interface CpoAdaptername - The String name of the UPDATE Function 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.wheres - A collection of CpoWhere objects to be used by the functionorderBy - A collection of CpoOrderBy objects to be used by the functionnativeExpressions - A collection of CpoNativeFunction objects to be used by the functionCpoException - Thrown if there are errors accessing the datasourcepublic CpoMetaDescriptor getCpoMetaDescriptor()
getCpoMetaDescriptor in interface CpoAdapterpublic String getDataSourceName()
getDataSourceName in interface CpoAdapterpublic List<CpoAttribute> getCpoAttributes(String expression) throws CpoException
getCpoAttributes in interface CpoAdapterCpoExceptionpublic boolean isSameRM(XAResource xaResource) throws XAException
isSameRM in interface XAResourcexaResource - - An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.XAException - - An error has occurred. Possible exception values are XAER_RMERR and XAER_RMFAIL.public boolean isLocalResourceBusy()
throws XAException
isLocalResourceBusy in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionprotected void prepareResource(JdbcCpoAdapter jdbcCpoAdapter) throws XAException
prepareResource in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionpublic void commitResource(JdbcCpoAdapter jdbcCpoAdapter) throws XAException
commitResource in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionpublic void rollbackResource(JdbcCpoAdapter jdbcCpoAdapter) throws XAException
rollbackResource in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionpublic JdbcCpoTrxAdapter createNewResource() throws XAException
createNewResource in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionpublic void closeResource(JdbcCpoAdapter jdbcCpoAdapter) throws XAException
closeResource in class CpoBaseXaResource<JdbcCpoAdapter>XAExceptionCopyright © 2016. All Rights Reserved.