|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.synchronoss.cpo.cache.CpoAdapterCache
org.synchronoss.cpo.CpoBaseAdapter<DataSource>
org.synchronoss.cpo.jdbc.JdbcCpoAdapter
public class JdbcCpoAdapter
JdbcCpoAdapter is an interface for a set of routines that are responsible for managing value objects from a datasource.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.synchronoss.cpo.CpoBaseAdapter |
|---|
CpoBaseAdapter.RetrieverThread<T,C> |
| Field Summary |
|---|
| Fields inherited from interface org.synchronoss.cpo.CpoAdapter |
|---|
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 |
| Constructor Summary | |
|---|---|
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. |
| Method Summary | ||
|---|---|---|
protected void |
clearConnectionBusy(Connection c)
|
|
protected void |
closeConnection(Connection connection)
DOCUMENT ME! |
|
protected void |
commitConnection(Connection connection)
DOCUMENT ME! |
|
|
deleteObject(String name,
T obj)
Removes the Object from the datasource. |
|
|
deleteObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Removes the Object from the datasource. |
|
|
deleteObject(T obj)
Removes the Object from the datasource. |
|
|
deleteObjects(Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
deleteObjects(String name,
Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
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. |
|
|
executeObject(String name,
C criteria,
T result)
Executes an Object that represents an executable object within the datasource. |
|
|
executeObject(String name,
T object)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
executeObject(T object)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
existsObject(String name,
T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(String name,
T obj,
Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
protected
|
existsObject(String name,
T obj,
Connection con,
Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
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
|
getGroupType(T obj,
String type,
String name,
Connection c)
DOCUMENT ME! |
|
static JdbcCpoAdapter |
getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo jdsiTrx)
|
|
static JdbcCpoAdapter |
getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo jdsiWrite,
DataSourceInfo jdsiRead)
Creates a JdbcCpoAdapter. |
|
protected Connection |
getReadConnection()
DOCUMENT ME! |
|
protected Connection |
getStaticConnection()
|
|
protected Connection |
getWriteConnection()
DOCUMENT ME! |
|
|
insertObject(String name,
T obj)
Creates the Object in the datasource. |
|
|
insertObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Creates the Object in the datasource. |
|
|
insertObject(T obj)
Creates the Object in the datasource. |
|
|
insertObjects(Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
|
insertObjects(String name,
Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
|
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! |
|
|
newWhere(int logical,
String attr,
int comp,
T value)
DOCUMENT ME! |
|
|
newWhere(int logical,
String attr,
int comp,
T value,
boolean not)
DOCUMENT ME! |
|
|
persistObject(String name,
T obj)
Persists the Object into the datasource. |
|
|
persistObject(T obj)
Persists the Object into the datasource. |
|
|
persistObjects(Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
persistObjects(String name,
Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
protected
|
processBatchUpdateGroup(T[] arr,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME! |
|
protected
|
processExecuteGroup(String name,
C criteria,
T result)
Executes an Object whose MetaData contains a stored procedure. |
|
protected
|
processExecuteGroup(String name,
C criteria,
T result,
Connection conn)
DOCUMENT ME! |
|
protected
|
processSelectGroup(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
boolean useRetrieve)
DOCUMENT ME! |
|
protected
|
processSelectGroup(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
boolean useRetrieve,
CpoResultSet<T> resultSet)
|
|
protected
|
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
|
processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the Object from the datasource. |
|
protected
|
processSelectGroup(T obj,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(Collection<T> coll,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(Collection<T> coll,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(T obj,
String groupType,
String groupName,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
Connection con)
DOCUMENT ME! |
|
|
retrieveBean(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBean(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource. |
|
|
retrieveBean(String name,
T bean)
Retrieves the bean from the datasource. |
|
|
retrieveBean(String name,
T bean,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource. |
|
|
retrieveBean(T bean)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
CpoWhere where,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
T result)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(String name,
C criteria,
T result,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions,
int queueSize)
Retrieves the bean from the datasource. |
|
|
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)
|
|
|
updateObject(String name,
T obj)
Update the Object in the datasource. |
|
|
updateObject(String name,
T obj,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Update the Object in the datasource. |
|
|
updateObject(T obj)
Update the Object in the datasource. |
|
|
updateObjects(Collection<T> coll)
Updates a collection of Objects in the datasource. |
|
|
updateObjects(String name,
Collection<T> coll)
Updates a collection of Objects in the datasource. |
|
|
updateObjects(String name,
Collection<T> coll,
Collection<CpoWhere> wheres,
Collection<CpoOrderBy> orderBy,
Collection<CpoNativeFunction> nativeExpressions)
Updates a collection of Objects in the datasource. |
|
| Methods inherited from class org.synchronoss.cpo.CpoBaseAdapter |
|---|
getDataSourceName, getReadDataSource, getWriteDataSource, setDataSourceName, setReadDataSource, setWriteDataSource |
| Methods inherited from class org.synchronoss.cpo.cache.CpoAdapterCache |
|---|
addCpoAdapter, findCpoAdapter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected 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 - exception
protected 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 - exception
protected JdbcCpoAdapter(JdbcCpoMetaDescriptor metaDescriptor,
boolean batchSupported,
String dataSourceName)
throws CpoException
metaDescriptor - batchSupported - dataSourceName -
CpoException| Method Detail |
|---|
public static JdbcCpoAdapter getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo jdsiTrx)
throws CpoException
CpoException
public static JdbcCpoAdapter getInstance(JdbcCpoMetaDescriptor metaDescriptor,
DataSourceInfo jdsiWrite,
DataSourceInfo 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 - exception
public <T> long insertObject(T obj)
throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.insertObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj - This is an object that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <T> long deleteObject(T obj)
throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.deleteObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj - This is an object that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. If the object does not exist in the datasource an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 datasource
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
}
}
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 datasource
public <T> long existsObject(T obj)
throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
count = cpo.existsObject(so);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
obj - This is an object that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. This object will be searched for inside the datasource.
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 exist
CpoException - Thrown if there are errors accessing the datasource
protected <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 exists
CpoException - exception will be thrown if the Function Group has a function count != 1
public 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 datasource
public 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 datasource
public 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 counterpart
CpoException - Thrown if there are errors accessing the datasource
public 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 counterpart
CpoException - Thrown if there are errors accessing the datasource
public 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 datasource
public <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 datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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 returned
CpoException - Thrown if there are errors accessing the datasource
public <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-time
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <T> long updateObject(T obj)
throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.updateObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
obj - This is an object that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 function
CpoException - Thrown if there are errors accessing the datasource
public <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 datasource
public <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 datasource
public <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 function
CpoException - Thrown if there are errors accessing the datasource
protected 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 the
CpoException - 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 function
CpoException - 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>CpoException
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)
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
CpoException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||