public class JdbcCpoAdapter extends CpoBaseAdapter<DataSource>
CpoBaseAdapter.RetrieverThread<T,C>CREATE, 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_GROUP| Modifier | Constructor and Description |
|---|---|
protected |
JdbcCpoAdapter() |
protected |
JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor,
boolean batchSupported,
String dataSourceName)
This constructor is used specifically to create a JdbcCpoTrxAdapter.
|
protected |
JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo<DataSource> jdsiTrx)
Creates a JdbcCpoAdapter.
|
protected |
JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo<DataSource> jdsiWrite,
DataSourceInfo<DataSource> jdsiRead)
Creates a JdbcCpoAdapter.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearConnectionBusy(Connection c) |
protected void |
closeConnection(Connection connection)
DOCUMENT ME!
|
protected void |
commitConnection(Connection connection)
DOCUMENT ME!
|
<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 object)
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.
|
protected <T> long |
existsObject(String name,
T obj,
Connection con,
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.
|
protected Context |
getContext()
DOCUMENT ME!
|
List<CpoAttribute> |
getCpoAttributes(String expression) |
CpoMetaDescriptor |
getCpoMetaDescriptor() |
CpoTrxAdapter |
getCpoTrxAdapter()
Provides a mechanism for the user to obtain a CpoTrxAdapter object.
|
protected <T> String |
getGroupType(T obj,
String type,
String name,
Connection c)
DOCUMENT ME!
|
static JdbcCpoAdapter |
getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo<DataSource> jdsiTrx) |
static JdbcCpoAdapter |
getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo<DataSource> jdsiWrite,
DataSourceInfo<DataSource> jdsiRead)
Creates a JdbcCpoAdapter.
|
protected Connection |
getReadConnection()
DOCUMENT ME!
|
protected Connection |
getStaticConnection() |
protected Connection |
getWriteConnection()
DOCUMENT ME!
|
<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.
|
protected boolean |
isConnectionBusy(Connection c) |
protected boolean |
isStaticConnection(Connection c) |
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 obj)
Persists the Object into the datasource.
|
<T> long |
persistObject(T obj)
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 <T> long |
processBatchUpdateGroup(T[] arr,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME!
|
protected <T,C> T |
processExecuteGroup(String name,
C criteria,
T result)
Executes an Object whose MetaData contains a stored procedure.
|
protected <T,C> T |
processExecuteGroup(String name,
C criteria,
T result,
Connection conn)
DOCUMENT ME!
|
protected <T,C> List<T> |
processSelectGroup(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
boolean useRetrieve)
DOCUMENT ME!
|
protected <T,C> void |
processSelectGroup(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
boolean useRetrieve,
CpoResultSet<T> resultSet) |
protected <T,C> void |
processSelectGroup(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con,
boolean useRetrieve,
CpoResultSet<T> resultSet)
DOCUMENT ME!
|
protected <T> T |
processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the Object from the datasource.
|
protected <T> T |
processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME!
|
protected <T> long |
processUpdateGroup(Collection<T> coll,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
DOCUMENT ME!
|
protected <T> long |
processUpdateGroup(Collection<T> coll,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME!
|
protected <T> long |
processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
DOCUMENT ME!
|
protected <T> long |
processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME!
|
<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.
|
protected void |
rollbackConnection(Connection connection)
DOCUMENT ME!
|
protected void |
setConnectionBusy(Connection c) |
protected void |
setContext(Context context)
DOCUMENT ME!
|
protected void |
setStaticConnection(Connection c) |
<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.
|
getDataSourceName, getReadDataSource, getWriteDataSource, setDataSourceName, setReadDataSource, setWriteDataSourceaddCpoAdapter, findCpoAdapterprotected JdbcCpoAdapter()
protected JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor, DataSourceInfo<DataSource> jdsiTrx) throws CpoException
metaDescriptor - This datasource that identifies the cpo metadata datasourcejdsiTrx - The datasoruce that identifies the transaction database.CpoException - exceptionprotected JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor, DataSourceInfo<DataSource> jdsiWrite, DataSourceInfo<DataSource> jdsiRead) throws CpoException
metaDescriptor - This datasource that identifies the cpo metadata datasourcejdsiWrite - The datasource that identifies the transaction database for write transactions.jdsiRead - The datasource that identifies the transaction database for read-only transactions.CpoException - exceptionprotected JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor, boolean batchSupported, String dataSourceName) throws CpoException
metaDescriptor - batchSupported - dataSourceName - CpoExceptionpublic static JdbcCpoAdapter getInstance(JdbcCpoMetaDescriptor metaDescriptor, DataSourceInfo<DataSource> jdsiTrx) throws CpoException
CpoExceptionpublic static JdbcCpoAdapter getInstance(JdbcCpoMetaDescriptor metaDescriptor, DataSourceInfo<DataSource> jdsiWrite, DataSourceInfo<DataSource> jdsiRead) throws CpoException
metaDescriptor - This datasource that identifies the cpo metadata datasourcejdsiWrite - The datasource that identifies the transaction database for write transactions.jdsiRead - The datasource that identifies the transaction database for read-only transactions.CpoException - exceptionpublic <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 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
}
}
name - 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
}
}
name - 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
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 datasourcepublic <T> long insertObjects(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.insertObjects("IdNameInsert",al);
} catch (CpoException ce) {
// Handle the error
}
}
name - 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
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 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
}
}
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) 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 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
}
}
name - 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
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 datasourcepublic <T> long deleteObjects(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.deleteObjects("IdNameDelete",al);
} catch (CpoException ce) {
// Handle the error
}
}
name - 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
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 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 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(so);
} catch (CpoException ce) {
// Handle the error
}
}
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 arguments 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
}
}
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 arguments 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 - if there are errors accessing the datasourcepublic <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
}
}
name - 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 arguments 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
}
}
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) 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 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
}
}
name - 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 CpoWhere object that passes in run-time constraints to the function that performs the the existCpoException - Thrown if there are errors accessing the datasourceprotected <T> long existsObject(String name, T obj, Connection con, Collection<CpoWhere> wheres) throws CpoException
name - The name which identifies which EXISTS, INSERT, and UPDATE Function 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.con - The datasource Connection with which to check if the object existsCpoException - exception will be thrown if the Function Group has a function count != 1public CpoOrderBy newOrderBy(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 datasourcepublic CpoOrderBy newOrderBy(String marker, String attribute, boolean ascending) throws CpoException
marker - 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
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 counterpartCpoException - Thrown if there are errors accessing the datasourcepublic CpoOrderBy newOrderBy(String marker, String attribute, boolean ascending, String function) throws CpoException
marker - 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
CpoException - DOCUMENT ME!public <T> CpoWhere newWhere(int logical, String attr, int comp, T value) throws CpoException
logical - DOCUMENT ME!attr - DOCUMENT ME!comp - DOCUMENT ME!value - DOCUMENT ME!CpoException - DOCUMENT ME!public <T> CpoWhere newWhere(int logical, 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 - DOCUMENT ME!public <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)public <T> long persistObject(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 Function 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)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
}
}
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> 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
}
}
name - 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
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) throws CpoException
name - 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
name - 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
name - 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 arguments 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
name - 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 arguments 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
name - 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 arguments 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
name - 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 arguments 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<CpoWhere> wheres, Collection<CpoOrderBy> orderBy) throws CpoException
name - 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 arguments 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 <C> List<C> retrieveBeans(String name, C criteria, Collection<CpoOrderBy> orderBy) throws CpoException
name - 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 arguments 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 <T,C> List<T> retrieveBeans(String name, C criteria, T result) throws CpoException
name - 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 arguments 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
name - 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 arguments 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
name - 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 arguments 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
name - 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 arguments 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
name - 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 arguments 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 - the maximum number of beans that the Iterator is allowed to cache. Once reached, the CPO
framework will halt processing records from the datasource.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
}
}
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) 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 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
}
}
name - 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
}
}
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) 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 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
}
}
name - 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 datasourceprotected void setContext(Context context) throws CpoException
context - DOCUMENT ME!CpoException - DOCUMENT ME!protected Context getContext()
protected <T> String getGroupType(T obj, String type, String name, Connection c) throws CpoException
obj - DOCUMENT ME!type - DOCUMENT ME!name - DOCUMENT ME!c - DOCUMENT ME!CpoException - DOCUMENT ME!protected Connection getReadConnection() throws CpoException
CpoException - DOCUMENT ME!protected Connection getWriteConnection() throws CpoException
CpoException - DOCUMENT ME!protected Connection getStaticConnection() throws CpoException
CpoExceptionprotected boolean isStaticConnection(Connection c)
protected void setStaticConnection(Connection c)
protected void closeConnection(Connection connection)
connection - DOCUMENT ME!protected void commitConnection(Connection connection)
connection - DOCUMENT ME!protected void rollbackConnection(Connection connection)
connection - DOCUMENT ME!protected <T,C> T processExecuteGroup(String name, C criteria, 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 populate the IN arguments 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 returned in theCpoException - DOCUMENT ME!protected <T,C> T processExecuteGroup(String name, C criteria, T result, Connection conn) throws CpoException
name - DOCUMENT ME!criteria - DOCUMENT ME!result - DOCUMENT ME!conn - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> T processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
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. The input object is used to specify the search criteria.groupName - The name which identifies which RETRIEVE Function Group to execute to retrieve the object.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 - the retrieve function defined for this objects returns more than one row, an exception will be
thrown.protected <T> T processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
throws CpoException
obj - DOCUMENT ME!groupName - DOCUMENT ME!con - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T,C> List<T> processSelectGroup(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, boolean useRetrieve) throws CpoException
name - DOCUMENT ME!criteria - DOCUMENT ME!result - DOCUMENT ME!wheres - DOCUMENT ME!orderBy - DOCUMENT ME!useRetrieve - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T,C> void processSelectGroup(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, boolean useRetrieve, CpoResultSet<T> resultSet) throws CpoException
processSelectGroup in class CpoBaseAdapter<DataSource>CpoExceptionprotected <T,C> void processSelectGroup(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Connection con, boolean useRetrieve, CpoResultSet<T> resultSet) throws CpoException
name - DOCUMENT ME!criteria - DOCUMENT ME!result - DOCUMENT ME!wheres - DOCUMENT ME!orderBy - DOCUMENT ME!con - DOCUMENT ME!useRetrieve - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> long processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
throws CpoException
obj - DOCUMENT ME!groupType - DOCUMENT ME!groupName - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> long processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
throws CpoException
obj - DOCUMENT ME!groupType - DOCUMENT ME!groupName - DOCUMENT ME!con - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> long processBatchUpdateGroup(T[] arr,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
throws CpoException
arr - DOCUMENT ME!groupType - DOCUMENT ME!groupName - DOCUMENT ME!con - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException
coll - DOCUMENT ME!groupType - DOCUMENT ME!groupName - DOCUMENT ME!CpoException - DOCUMENT ME!protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Connection con) throws CpoException
coll - DOCUMENT ME!groupType - DOCUMENT ME!groupName - DOCUMENT ME!wheres - DOCUMENT ME!orderBy - DOCUMENT ME!nativeExpressions - DOCUMENT ME!con - DOCUMENT ME!CpoException - DOCUMENT ME!public CpoTrxAdapter 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 datasourceCpoTrxAdapterprotected boolean isConnectionBusy(Connection c)
protected void setConnectionBusy(Connection c)
protected void clearConnectionBusy(Connection c)
public CpoMetaDescriptor getCpoMetaDescriptor()
public List<CpoAttribute> getCpoAttributes(String expression) throws CpoException
CpoExceptionCopyright © 2014. All Rights Reserved.