|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Field Summary |
---|
Fields inherited from interface org.synchronoss.cpo.CpoAdapter |
---|
CREATE, DELETE, EXECUTE, EXIST, INSERT, LIST, PERSIST, RETRIEVE, UPDATE |
Constructor Summary | |
---|---|
protected |
JdbcCpoAdapter()
|
protected |
JdbcCpoAdapter(javax.sql.DataSource metaSource,
java.lang.String metaSourceName,
boolean batchSupported,
java.lang.String dbTablePrefix)
|
|
JdbcCpoAdapter(JdbcDataSourceInfo jdsi)
Creates a JdbcCpoAdapter. |
|
JdbcCpoAdapter(JdbcDataSourceInfo jdsiMeta,
JdbcDataSourceInfo jdsiTrx)
Creates a JdbcCpoAdapter. |
|
JdbcCpoAdapter(JdbcDataSourceInfo jdsiMeta,
JdbcDataSourceInfo jdsiWrite,
JdbcDataSourceInfo jdsiRead)
Creates a JdbcCpoAdapter. |
Method Summary | ||
---|---|---|
protected void |
clearConnectionBusy(java.sql.Connection c)
|
|
void |
clearMetaClass()
Clears the metadata for all classes for the current datasource. |
|
void |
clearMetaClass(boolean all)
Clears the metadata for all classes. |
|
void |
clearMetaClass(java.lang.Object obj)
Clears the metadata for the specified object. |
|
void |
clearMetaClass(java.lang.String className)
Clears the metadata for the specified fully qualifed class name. |
|
protected void |
closeConnection(java.sql.Connection connection)
DOCUMENT ME! |
|
protected void |
commitConnection(java.sql.Connection connection)
DOCUMENT ME! |
|
|
deleteObject(java.lang.String name,
T obj)
Removes the Object from the datasource. |
|
|
deleteObject(T obj)
Removes the Object from the datasource. |
|
|
deleteObjects(java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
deleteObjects(java.lang.String name,
java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
executeObject(java.lang.String name,
C criteria,
T result)
Executes an Object that represents an executable object within the datasource. |
|
|
executeObject(java.lang.String name,
T object)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
executeObject(T object)
Executes an Object whose metadata will call an executable within the datasource. |
|
|
existsObject(java.lang.String name,
T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(java.lang.String name,
T obj,
java.util.Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
protected
|
existsObject(java.lang.String name,
T obj,
java.sql.Connection con,
java.sql.Connection metaCon,
java.util.Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
protected javax.naming.Context |
getContext()
DOCUMENT ME! |
|
CpoTrxAdapter |
getCpoTrxAdapter()
Provides a mechanism for the user to obtain a CpoTrxAdapter object. |
|
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,JdbcMetaClass<?>>> |
getDataSourceMap()
DOCUMENT ME! |
|
java.lang.String |
getDbTablePrefix()
|
|
protected
|
getGroupType(T obj,
java.lang.String type,
java.lang.String name,
java.sql.Connection c,
java.sql.Connection meta)
DOCUMENT ME! |
|
protected
|
getMetaClass(T obj,
java.sql.Connection c)
DOCUMENT ME! |
|
protected java.util.HashMap<java.lang.String,JdbcMetaClass<?>> |
getMetaClassMap()
|
|
protected java.sql.Connection |
getMetaConnection()
DOCUMENT ME! |
|
protected javax.sql.DataSource |
getMetaDataSource()
DOCUMENT ME! |
|
protected java.lang.String |
getMetaDataSourceName()
DOCUMENT ME! |
|
protected java.sql.Connection |
getReadConnection()
DOCUMENT ME! |
|
protected javax.sql.DataSource |
getReadDataSource()
DOCUMENT ME! |
|
protected java.sql.Connection |
getStaticConnection()
|
|
protected java.sql.Connection |
getWriteConnection()
DOCUMENT ME! |
|
protected javax.sql.DataSource |
getWriteDataSource()
DOCUMENT ME! |
|
|
insertObject(java.lang.String name,
T obj)
Creates the Object in the datasource. |
|
|
insertObject(T obj)
Creates the Object in the datasource. |
|
|
insertObjects(java.util.Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
|
insertObjects(java.lang.String name,
java.util.Collection<T> coll)
Iterates through a collection of Objects, creates and stores them in the datasource. |
|
protected boolean |
isConnectionBusy(java.sql.Connection c)
|
|
protected boolean |
isStaticConnection(java.sql.Connection c)
|
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending,
java.lang.String function)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoWhere |
newWhere()
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value)
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value,
boolean not)
DOCUMENT ME! |
|
|
persistObject(java.lang.String name,
T obj)
Persists the Object into the datasource. |
|
|
persistObject(T obj)
Persists the Object into the datasource. |
|
|
persistObjects(java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
persistObjects(java.lang.String name,
java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
protected
|
processBatchUpdateGroup(T[] arr,
java.lang.String groupType,
java.lang.String groupName,
java.sql.Connection con,
java.sql.Connection metaCon)
DOCUMENT ME! |
|
protected
|
processExecuteGroup(java.lang.String name,
C criteria,
T result)
Executes an Object whose MetaData contains a stored procedure. |
|
protected
|
processExecuteGroup(java.lang.String name,
C criteria,
T result,
java.sql.Connection conn,
java.sql.Connection metaCon)
DOCUMENT ME! |
|
protected
|
processSelectGroup(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
boolean useRetrieve)
DOCUMENT ME! |
|
protected
|
processSelectGroup(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
boolean useRetrieve,
CpoResultSet<T> resultSet)
|
|
protected
|
processSelectGroup(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
java.sql.Connection con,
java.sql.Connection metaCon,
boolean useRetrieve,
CpoResultSet<T> resultSet)
DOCUMENT ME! |
|
protected
|
processSelectGroup(T obj,
java.lang.String groupName)
Retrieves the Object from the datasource. |
|
protected
|
processSelectGroup(T obj,
java.lang.String groupName,
java.sql.Connection con,
java.sql.Connection metaCon)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(java.util.Collection<T> coll,
java.lang.String groupType,
java.lang.String groupName)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(java.util.Collection<T> coll,
java.lang.String groupType,
java.lang.String groupName,
java.sql.Connection con,
java.sql.Connection meta)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(T obj,
java.lang.String groupType,
java.lang.String groupName)
DOCUMENT ME! |
|
protected
|
processUpdateGroup(T obj,
java.lang.String groupType,
java.lang.String groupName,
java.sql.Connection con,
java.sql.Connection metaCon)
DOCUMENT ME! |
|
|
retrieveBean(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBean(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries)
Retrieves the bean from the datasource. |
|
|
retrieveBean(java.lang.String name,
T bean)
Retrieves the bean from the datasource. |
|
|
retrieveBean(T bean)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
T result)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
int queueSize)
Retrieves the bean from the datasource. |
|
|
retrieveBeans(java.lang.String name,
C criteria,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the bean from the datasource. |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Deprecated. use retrieveBean |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries)
Deprecated. use retrieveBean |
|
|
retrieveObject(java.lang.String name,
T obj)
Deprecated. use retrieveBean |
|
|
retrieveObject(T obj)
Deprecated. use retrieveBean |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
T result)
Deprecated. use retrieveBeans |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQueries,
T result,
int queueSize)
Deprecated. use retrieveBeans |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
T result)
Deprecated. use retrieveBeans |
|
protected void |
rollbackConnection(java.sql.Connection connection)
DOCUMENT ME! |
|
protected void |
setConnectionBusy(java.sql.Connection c)
|
|
protected void |
setContext(javax.naming.Context context)
DOCUMENT ME! |
|
protected void |
setDataSourceMap(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,JdbcMetaClass<?>>> dsMap)
|
|
void |
setDbTablePrefix(java.lang.String dbTablePrefix)
|
|
protected void |
setMetaDataSource(javax.sql.DataSource metaDataSource)
DOCUMENT ME! |
|
protected void |
setMetaDataSourceName(java.lang.String metaDataSourceName)
DOCUMENT ME! |
|
protected void |
setReadDataSource(javax.sql.DataSource readDataSource)
DOCUMENT ME! |
|
protected void |
setStaticConnection(java.sql.Connection c)
|
|
protected void |
setWriteDataSource(javax.sql.DataSource writeDataSource)
DOCUMENT ME! |
|
|
transactObjects(java.util.Collection<CpoObject<T>> coll)
Deprecated. |
|
protected
|
transactObjects(java.util.Collection<CpoObject<T>> coll,
java.sql.Connection c,
java.sql.Connection meta)
Deprecated. |
|
|
updateObject(java.lang.String name,
T obj)
Update the Object in the datasource. |
|
|
updateObject(T obj)
Update the Object in the datasource. |
|
|
updateObjects(java.util.Collection<T> coll)
Updates a collection of Objects in the datasource. |
|
|
updateObjects(java.lang.String name,
java.util.Collection<T> coll)
Updates a collection of Objects in the datasource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JdbcCpoAdapter()
public JdbcCpoAdapter(JdbcDataSourceInfo jdsi) throws CpoException
jdsi
- This datasource will be used for both the metadata
and the transaction database.
CpoException
- exceptionpublic JdbcCpoAdapter(JdbcDataSourceInfo jdsiMeta, JdbcDataSourceInfo jdsiTrx) throws CpoException
jdsiMeta
- This datasource that identifies the cpo metadata datasourcejdsiTrx
- The datasoruce that identifies the transaction database.
CpoException
- exceptionpublic JdbcCpoAdapter(JdbcDataSourceInfo jdsiMeta, JdbcDataSourceInfo jdsiWrite, JdbcDataSourceInfo jdsiRead) throws CpoException
jdsiMeta
- 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(javax.sql.DataSource metaSource, java.lang.String metaSourceName, boolean batchSupported, java.lang.String dbTablePrefix) throws CpoException
CpoException
Method Detail |
---|
public void clearMetaClass(java.lang.Object obj)
clearMetaClass
in interface CpoAdapter
obj
- The object whose metadata must be clearedpublic void clearMetaClass(java.lang.String className)
clearMetaClass
in interface CpoAdapter
className
- The fully qualified class name for the class that needs its
metadata cleared.public void clearMetaClass(boolean all)
clearMetaClass
in interface CpoAdapter
all
- true - clear all classes for all datasources.
false - clear all classes for the current datasource.
CpoException
- Thrown if there are errors accessing the datasourcepublic void clearMetaClass()
clearMetaClass
in interface CpoAdapter
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long insertObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.insertObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
insertObject
in interface CpoAdapter
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(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.insertObject("IDNameInsert",so);
} catch (CpoException ce) {
// Handle the error
}
}
insertObject
in interface CpoAdapter
name
- The String name of the CREATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used which is
equivalent to insertObject(Object obj);obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long insertObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.insertObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
insertObjects
in interface CpoAdapter
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(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.insertObjects("IdNameInsert",al);
} catch (CpoException ce) {
// Handle the error
}
}
insertObjects
in interface CpoAdapter
name
- The String name of the CREATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long deleteObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.deleteObject(so);
} catch (CpoException ce) {
// Handle the error
}
}
deleteObject
in interface CpoAdapter
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(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.deleteObject("DeleteById",so);
} catch (CpoException ce) {
// Handle the error
}
}
deleteObject
in interface CpoAdapter
name
- The String name of the DELETE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long deleteObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.deleteObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
deleteObjects
in interface CpoAdapter
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(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.deleteObjects("IdNameDelete",al);
} catch (CpoException ce) {
// Handle the error
}
}
deleteObjects
in interface CpoAdapter
name
- The String name of the DELETE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the 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
}
}
executeObject
in interface CpoAdapter
object
- This is an Object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to 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(java.lang.String name, T object) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.executeObject("execNotifyProc",so);
} catch (CpoException ce) {
// Handle the error
}
}
executeObject
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.object
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to retrieve the collection of objects.
This object defines the object type that will be returned in the collection and
contain the result set data or the OUT Parameters.
CpoException
- if there are errors accessing the datasourcepublic <T,C> T executeObject(java.lang.String name, C criteria, T result) throws CpoException
Example:
class SomeObject so = new SomeObject();
class SomeResult sr = new SomeResult();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
sr = (SomeResult)cpo.executeObject("execNotifyProc",so, sr);
} catch (CpoException ce) {
// Handle the error
}
}
executeObject
in interface CpoAdapter
name
- The String name of the EXECUTE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object defines the
object type that will be created, filled with the return data and returned from this
method.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long existsObject(T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
count = cpo.existsObject(so);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
existsObject
in interface CpoAdapter
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(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
count = cpo.existsObject("SomeExistCheck",so);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
existsObject
in interface CpoAdapter
name
- The String name of the EXISTS Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. This object will be searched for inside the
datasource.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long existsObject(java.lang.String name, T obj, java.util.Collection<CpoWhere> wheres) throws CpoException
Example:
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
CpoWhere where = cpo.newCpoWhere(CpoWhere.LOGIC_NONE, id, CpoWhere.COMP_EQ);
count = cpo.existsObject("SomeExistCheck",so, where);
if (count>0) {
// object exists
} else {
// object does not exist
}
} catch (CpoException ce) {
// Handle the error
}
}
existsObject
in interface CpoAdapter
name
- The String name of the EXISTS Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. This object will be searched for inside the
datasource.where
- A CpoWhere object that passes in run-time constraints to the query that performs the
the exist
CpoException
- Thrown if there are errors accessing the datasourceprotected <T> long existsObject(java.lang.String name, T obj, java.sql.Connection con, java.sql.Connection metaCon, java.util.Collection<CpoWhere> wheres) throws CpoException
name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups to
execute to persist the object.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.con
- The datasource Connection with which to check if the object existsmetaCon
- metadataconnection
CpoException
- exception will be thrown if the Query Group has a query count != 1public CpoOrderBy newOrderBy(java.lang.String attribute, boolean ascending) throws CpoException
newOrderBy
in interface CpoAdapter
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(java.lang.String attribute, boolean ascending, java.lang.String function) throws CpoException
newOrderBy
in interface CpoAdapter
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 datasourcepublic CpoWhere newWhere() throws CpoException
newWhere
in interface CpoAdapter
CpoException
- DOCUMENT ME!public <T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value) throws CpoException
newWhere
in interface CpoAdapter
logical
- DOCUMENT ME!attr
- DOCUMENT ME!comp
- DOCUMENT ME!value
- DOCUMENT ME!
CpoException
- DOCUMENT ME!public <T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value, boolean not) throws CpoException
newWhere
in interface CpoAdapter
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
}
}
persistObject
in interface CpoAdapter
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(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.persistObject("persistSomeObject",so);
} catch (CpoException ce) {
// Handle the error
}
}
persistObject
in interface CpoAdapter
name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups to
execute to persist the object.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
public <T> long persistObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.persistObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
persistObjects
in interface CpoAdapter
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(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.persistObjects("myPersist",al);
} catch (CpoException ce) {
// Handle the error
}
}
persistObjects
in interface CpoAdapter
name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups to
execute to persist the object.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceexistsObject(T)
,
insertObject(T)
,
updateObject(T)
public <T> T retrieveBean(T bean) throws CpoException
retrieveBean
in interface CpoAdapter
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 query.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> T retrieveBean(java.lang.String name, T bean) throws CpoException
retrieveBean
in interface CpoAdapter
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 query.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> T retrieveBean(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBean
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returned
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> T retrieveBean(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries) throws CpoException
retrieveBean
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasourcepublic <C> java.util.List<C> retrieveBeans(java.lang.String name, C criteria) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.
CpoException
- Thrown if there are errors accessing the datasourcepublic <C> java.util.List<C> retrieveBeans(java.lang.String name, C criteria, CpoWhere where, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.where
- A CpoWhere bean that defines the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returned
CpoException
- Thrown if there are errors accessing the datasourcepublic <C> java.util.List<C> retrieveBeans(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returned
CpoException
- Thrown if there are errors accessing the datasourcepublic <C> java.util.List<C> retrieveBeans(java.lang.String name, C criteria, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters 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 datasourcepublic <T,C> java.util.List<T> retrieveBeans(java.lang.String name, C criteria, T result) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> java.util.List<T> retrieveBeans(java.lang.String name, C criteria, T result, CpoWhere where, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.where
- A CpoWhere bean that defines the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returned
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> java.util.List<T> retrieveBeans(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returned
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> java.util.List<T> retrieveBeans(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasourcepublic <T,C> CpoResultSet<T> retrieveBeans(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, int queueSize) throws CpoException
retrieveBeans
in interface CpoAdapter
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 parameters used to retrieve the collection of beans.result
- This is an bean that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the bean does not
exist in the datasource, an exception will be thrown. This bean is used to specify
the bean type that will be returned in the collection.wheres
- A collection of CpoWhere beans that define the constraints that should be
used when retrieving beansorderBy
- The CpoOrderBy bean that defines the order in which beans
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-timebeanBufferSize
- 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@Deprecated public <T> T retrieveObject(T obj) throws CpoException
retrieveObject
in interface CpoAdapter
obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource, an exception will be thrown. The input object is used to specify
the search criteria, the output object is populated with the results of the query.
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T> T retrieveObject(java.lang.String name, T obj) throws CpoException
retrieveObject
in interface CpoAdapter
name
- DOCUMENT ME!obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown. If the object does not exist
in the datasource, an exception will be thrown. The input object is used to specify
the search criteria, the output object is populated with the results of the query.
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T,C> T retrieveObject(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy) throws CpoException
retrieveObject
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returned
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T,C> T retrieveObject(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries) throws CpoException
retrieveObject
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T,C> java.util.Collection<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, T result) throws CpoException
retrieveObjects
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returned
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T,C> java.util.Collection<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, T result) throws CpoException
retrieveObjects
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-time
CpoException
- Thrown if there are errors accessing the datasource@Deprecated public <T,C> CpoResultSet<T> retrieveObjects(java.lang.String name, C criteria, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, T result, int queueSize) throws CpoException
retrieveObjects
in interface CpoAdapter
name
- The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.criteria
- This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to specify the parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object is used to specify
the object type that will be returned in the collection.wheres
- A collection of CpoWhere objects that define the constraints that should be
used when retrieving objectsorderBy
- The CpoOrderBy object that defines the order in which objects
should be returnednativeQueries
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-timeobjectBufferSize
- the maximum number of objects 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@Deprecated public <T> long transactObjects(java.util.Collection<CpoObject<T>> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
CpoObject cobj = new CpoObject(CpoAdapter.CREATE,"MyCreate",so);
al.add(cobj);
so = new SomeObject();
so.setId(3);
so.setName("New Name");
CpoObject cobj = new CpoObject(CpoAdapter.PERSIST,"MyPersist",so);
al.add(cobj);
try{
cpo.transactObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
transactObjects
in interface CpoAdapter
coll
- This is a collection of CpoObject objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasource@Deprecated protected <T> long transactObjects(java.util.Collection<CpoObject<T>> coll, java.sql.Connection c, java.sql.Connection meta) throws CpoException
coll
- DOCUMENT ME!meta
- metadata connc
- DOCUMENT ME!
CpoException
- DOCUMENT ME!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
}
}
updateObject
in interface CpoAdapter
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(java.lang.String name, T obj) throws CpoException
Example:
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
so.setId(1);
so.setName("SomeName");
try{
cpo.updateObject("updateSomeObject",so);
} catch (CpoException ce) {
// Handle the error
}
}
updateObject
in interface CpoAdapter
name
- The String name of the UPDATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.obj
- This is an object that has been defined within the metadata of the datasource. If
the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long updateObjects(java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.updateObjects(al);
} catch (CpoException ce) {
// Handle the error
}
}
updateObjects
in interface CpoAdapter
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(java.lang.String name, java.util.Collection<T> coll) throws CpoException
Example:
class SomeObject so = null;
class CpoAdapter cpo = null;
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
// Handle the error
cpo = null;
}
if (cpo!=null) {
ArrayList al = new ArrayList();
for (int i=0; i<3; i++){
so = new SomeObject();
so.setId(1);
so.setName("SomeName");
al.add(so);
}
try{
cpo.updateObjects("myUpdate",al);
} catch (CpoException ce) {
// Handle the error
}
}
updateObjects
in interface CpoAdapter
name
- The String name of the UPDATE Query group that will be used to create the object
in the datasource. null signifies that the default rules will be used.coll
- This is a collection of objects that have been defined within the metadata of
the datasource. If the class is not defined an exception will be thrown.
CpoException
- Thrown if there are errors accessing the datasourceprotected void setContext(javax.naming.Context context) throws CpoException
context
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected javax.naming.Context getContext()
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,JdbcMetaClass<?>>> getDataSourceMap()
protected void setDataSourceMap(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,JdbcMetaClass<?>>> dsMap)
protected <T> java.lang.String getGroupType(T obj, java.lang.String type, java.lang.String name, java.sql.Connection c, java.sql.Connection meta) throws CpoException
obj
- DOCUMENT ME!type
- DOCUMENT ME!name
- DOCUMENT ME!c
- DOCUMENT ME!meta
- metadata conn
CpoException
- DOCUMENT ME!protected <T> JdbcMetaClass<T> getMetaClass(T obj, java.sql.Connection c) throws CpoException
obj
- DOCUMENT ME!c
- connection
CpoException
- DOCUMENT ME!protected java.util.HashMap<java.lang.String,JdbcMetaClass<?>> getMetaClassMap()
protected java.sql.Connection getReadConnection() throws CpoException
CpoException
- DOCUMENT ME!protected void setReadDataSource(javax.sql.DataSource readDataSource)
readDataSource
- DOCUMENT ME!protected javax.sql.DataSource getReadDataSource()
protected java.sql.Connection getWriteConnection() throws CpoException
CpoException
- DOCUMENT ME!protected java.sql.Connection getStaticConnection() throws CpoException
CpoException
protected boolean isStaticConnection(java.sql.Connection c)
protected void setStaticConnection(java.sql.Connection c)
protected void setWriteDataSource(javax.sql.DataSource writeDataSource)
writeDataSource
- DOCUMENT ME!protected javax.sql.DataSource getWriteDataSource()
protected java.sql.Connection getMetaConnection() throws CpoException
CpoException
- DOCUMENT ME!protected void setMetaDataSource(javax.sql.DataSource metaDataSource)
metaDataSource
- DOCUMENT ME!protected javax.sql.DataSource getMetaDataSource()
protected void setMetaDataSourceName(java.lang.String metaDataSourceName)
metaDataSourceName
- DOCUMENT ME!protected java.lang.String getMetaDataSourceName()
protected void closeConnection(java.sql.Connection connection)
connection
- DOCUMENT ME!protected void commitConnection(java.sql.Connection connection)
connection
- DOCUMENT ME!protected void rollbackConnection(java.sql.Connection connection)
connection
- DOCUMENT ME!protected <T,C> T processExecuteGroup(java.lang.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 parameters used to retrieve the collection of objects.result
- This is an object that has been defined within the metadata of the datasource.
If the class is not defined an exception will be thrown. If the object does not
exist in the datasource, an exception will be thrown. This object defines the object
type that will be returned in the
CpoException
- DOCUMENT ME!protected <T,C> T processExecuteGroup(java.lang.String name, C criteria, T result, java.sql.Connection conn, java.sql.Connection metaCon) throws CpoException
name
- DOCUMENT ME!criteria
- DOCUMENT ME!result
- DOCUMENT ME!conn
- DOCUMENT ME!metaCon
- metadata connection
CpoException
- DOCUMENT ME!protected <T> T processSelectGroup(T obj, java.lang.String groupName) 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 Query group to execute to retrieve
the object.
CpoException
- the retrieve query defined for this objects returns more than one
row, an exception will be thrown.protected <T> T processSelectGroup(T obj, java.lang.String groupName, java.sql.Connection con, java.sql.Connection metaCon) throws CpoException
obj
- DOCUMENT ME!groupName
- DOCUMENT ME!con
- DOCUMENT ME!metaCon
- metadata connection
CpoException
- DOCUMENT ME!protected <T,C> java.util.List<T> processSelectGroup(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, boolean useRetrieve) throws CpoException
name
- DOCUMENT ME!criteria
- DOCUMENT ME!result
- DOCUMENT ME!where
- DOCUMENT ME!orderBy
- DOCUMENT ME!useRetrieve
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T,C> void processSelectGroup(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, boolean useRetrieve, CpoResultSet<T> resultSet) throws CpoException
CpoException
protected <T,C> void processSelectGroup(java.lang.String name, C criteria, T result, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries, java.sql.Connection con, java.sql.Connection metaCon, boolean useRetrieve, CpoResultSet<T> resultSet) throws CpoException
name
- DOCUMENT ME!criteria
- DOCUMENT ME!result
- DOCUMENT ME!where
- DOCUMENT ME!orderBy
- DOCUMENT ME!con
- DOCUMENT ME!metaCon
- DOCUMENT ME!useRetrieve
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T> long processUpdateGroup(T obj, java.lang.String groupType, java.lang.String groupName) throws CpoException
obj
- DOCUMENT ME!groupType
- DOCUMENT ME!groupName
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T> long processUpdateGroup(T obj, java.lang.String groupType, java.lang.String groupName, java.sql.Connection con, java.sql.Connection metaCon) throws CpoException
obj
- DOCUMENT ME!groupType
- DOCUMENT ME!groupName
- DOCUMENT ME!con
- DOCUMENT ME!metaCon
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T> long processBatchUpdateGroup(T[] arr, java.lang.String groupType, java.lang.String groupName, java.sql.Connection con, java.sql.Connection metaCon) throws CpoException
arr
- DOCUMENT ME!groupType
- DOCUMENT ME!groupName
- DOCUMENT ME!con
- DOCUMENT ME!metaCon
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T> long processUpdateGroup(java.util.Collection<T> coll, java.lang.String groupType, java.lang.String groupName) throws CpoException
coll
- DOCUMENT ME!groupType
- DOCUMENT ME!groupName
- DOCUMENT ME!
CpoException
- DOCUMENT ME!protected <T> long processUpdateGroup(java.util.Collection<T> coll, java.lang.String groupType, java.lang.String groupName, java.sql.Connection con, java.sql.Connection meta) throws CpoException
coll
- DOCUMENT ME!groupType
- DOCUMENT ME!groupName
- DOCUMENT ME!con
- DOCUMENT ME!meta
- 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();
}
}
getCpoTrxAdapter
in interface CpoAdapter
CpoException
- Thrown if there are errors accessing the datasourceCpoTrxAdapter
public java.lang.String getDbTablePrefix()
public void setDbTablePrefix(java.lang.String dbTablePrefix)
protected boolean isConnectionBusy(java.sql.Connection c)
protected void setConnectionBusy(java.sql.Connection c)
protected void clearConnectionBusy(java.sql.Connection c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |