|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.synchronoss.cpo.CpoAdapterBean
public class CpoAdapterBean
Field Summary |
---|
Fields inherited from interface org.synchronoss.cpo.CpoAdapter |
---|
CREATE, DELETE, EXECUTE, EXIST, INSERT, LIST, PERSIST, RETRIEVE, UPDATE |
Constructor Summary | |
---|---|
CpoAdapterBean(CpoAdapter cpo)
|
Method Summary | ||
---|---|---|
void |
clearMetaClass()
Clears the metadata for all classes for the current datasource. |
|
void |
clearMetaClass(boolean all)
Clears the metadata for all classes. |
|
void |
clearMetaClass(java.lang.Object obj)
Clears the metadata for the specified object. |
|
void |
clearMetaClass(java.lang.String className)
Clears the metadata for the specified fully qualifed class name. |
|
|
deleteObject(java.lang.String name,
T obj)
Removes the Object from the datasource. |
|
|
deleteObject(T obj)
Removes the Object from the datasource. |
|
|
deleteObjects(java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
|
deleteObjects(java.lang.String name,
java.util.Collection<T> coll)
Removes the Objects contained in the collection from the datasource. |
|
void |
ejbActivate()
|
|
void |
ejbCreate()
|
|
void |
ejbPassivate()
|
|
void |
ejbRemove()
|
|
java.lang.Object |
executeAdapterMethod(java.lang.String name,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] args)
|
|
|
executeObject(java.lang.String name,
C criteria,
T result)
Executes an Object whose MetaData contains a stored procedure. |
|
|
executeObject(java.lang.String name,
T object)
Executes an Object whose MetaData contains a stored procedure. |
|
|
executeObject(T object)
Executes an Object whose MetaData contains a stored procedure. |
|
|
existsObject(java.lang.String name,
T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(java.lang.String name,
T obj,
java.util.Collection<CpoWhere> wheres)
The CpoAdapter will check to see if this object exists in the datasource. |
|
|
existsObject(T obj)
The CpoAdapter will check to see if this object exists in the datasource. |
|
java.lang.Class<?> |
getAdapterClass()
|
|
CpoTrxAdapter |
getCpoTrxAdapter()
Provides a mechanism for the user to obtain a CpoTrxAdapter object. |
|
|
insertObject(java.lang.String name,
T obj)
Creates the Object and stores it in the datasource. |
|
|
insertObject(T obj)
Creates the Object and stores it in the datasource. |
|
|
insertObjects(java.util.Collection<T> coll)
Iterates through a collection of Objects, creates them and stores them in the datasource. |
|
|
insertObjects(java.lang.String name,
java.util.Collection<T> coll)
Iterates through a collection of Objects, creates them and stores them in the datasource. |
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoOrderBy |
newOrderBy(java.lang.String attribute,
boolean ascending,
java.lang.String function)
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. |
|
CpoWhere |
newWhere()
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value)
DOCUMENT ME! |
|
|
newWhere(int logical,
java.lang.String attr,
int comp,
T value,
boolean not)
DOCUMENT ME! |
|
|
persistObject(java.lang.String name,
T obj)
Persists the Object into the datasource. |
|
|
persistObject(T obj)
Persists the Object into the datasource. |
|
|
persistObjects(java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
persistObjects(java.lang.String name,
java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the Object from the datasource. |
|
|
retrieveObject(java.lang.String name,
C criteria,
T result,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQuery)
Retrieves the Object from the datasource. |
|
|
retrieveObject(java.lang.String name,
T obj)
Retrieves the Object from the datasource. |
|
|
retrieveObject(T obj)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQuery,
T result)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
java.util.Collection<CpoNativeQuery> nativeQuery,
T result,
int queueSize)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
java.util.Collection<CpoWhere> wheres,
java.util.Collection<CpoOrderBy> orderBy,
T result)
Retrieves the Object from the datasource. |
|
void |
setSessionContext(javax.ejb.SessionContext A)
|
|
|
transactObjects(java.util.Collection<CpoObject<T>> coll)
Deprecated. |
|
|
updateObject(java.lang.String name,
T obj)
Persists the Object into the datasource. |
|
|
updateObject(T obj)
Persists the Object into the datasource. |
|
|
updateObjects(java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
|
|
updateObjects(java.lang.String name,
java.util.Collection<T> coll)
Persists a collection of Objects into the datasource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CpoAdapterBean(CpoAdapter cpo)
Method Detail |
---|
public void ejbCreate()
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void setSessionContext(javax.ejb.SessionContext A)
setSessionContext
in interface javax.ejb.SessionBean
public java.lang.Class<?> getAdapterClass() throws CpoException
CpoException
public java.lang.Object executeAdapterMethod(java.lang.String name, java.lang.Class<?>[] parameterTypes, java.lang.Object[] args) throws CpoException
CpoException
public <T> long insertObject(T obj) throws CpoException
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
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.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);
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long insertObjects(java.util.Collection<T> coll) throws CpoException
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
insertObjects
in interface CpoAdapter
name
- The the context name for which group of operations will be called to
process this insert.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 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 datasourcepublic <T> T retrieveObject(java.lang.String name, T obj) throws CpoException
retrieveObject
in interface CpoAdapter
name
- The the context name for which group of operations will be called to
process this retrieve.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 datasourcepublic <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 the context name for which group of operations will be called to
process this retrieve.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 datasourcepublic <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> nativeQuery) throws CpoException
retrieveObject
in interface CpoAdapter
name
- The the context name for which group of operations will be called to
process this retrieve.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 returnednativeQuery
- 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> 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 the context name for which group of operations will be called to
process this retrieve.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 datasourcepublic <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> nativeQuery, T result) throws CpoException
retrieveObjects
in interface CpoAdapter
name
- The the context name for which group of operations will be called to
process this retrieve.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 returnednativeQuery
- 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> long updateObject(T obj) throws CpoException
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
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.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.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long updateObjects(java.util.Collection<T> coll) throws CpoException
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
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.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.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long deleteObject(T obj) throws CpoException
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
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.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.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long deleteObjects(java.util.Collection<T> coll) throws CpoException
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
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.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.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long persistObject(T obj) throws CpoException
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.name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups
to execute to persist the object.
An
- exception is thrown if existsObject() returns a value > 1
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
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.
An
- exception is thrown if existsObject() returns a value > 1
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
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.name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups
to execute to persist the object.
An
- exception is thrown if existsObject() returns a value > 1
CpoException
java.rmi.RemoteException
existsObject(T)
,
insertObject(T)
,
updateObject(T)
public <T> long persistObjects(java.lang.String name, java.util.Collection<T> coll) throws CpoException
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.
An
- exception is thrown if existsObject() returns a value > 1
CpoException
java.rmi.RemoteException
existsObject(T)
,
insertObject(T)
,
updateObject(T)
public <T> long existsObject(T obj) throws CpoException
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.name
- The name which identifies which EXISTS, INSERT, and UPDATE Query groups
to execute to persist the object.
An
- exception will be thrown if the Query Group has a query count != 1
An
- exception will be thrown if the resultset has a record count != 1
An
- exception will be thrown if there is a column count != 1
An
- exception will be thrown if the column returned cannot be converted to an int
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> long existsObject(java.lang.String name, T obj) throws CpoException
existsObject
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.
An
- exception will be thrown if the Query Group has a query count != 1
An
- exception will be thrown if the resultset has a record count != 1
An
- exception will be thrown if there is a column count != 1
An
- exception will be thrown if the column returned cannot be converted to an int
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.wheres
- A Collection of CpoWhere objects that pass in run-time constraints to the query that performs the
the exist
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> T executeObject(T object) throws CpoException
executeObject
in interface CpoAdapter
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
collection and contain the result set data or the OUT Parameters.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.
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> T executeObject(java.lang.String name, T object) throws CpoException
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
- DOCUMENT ME!public <T,C> T executeObject(java.lang.String name, C criteria, T result) throws CpoException
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.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
collection and contain the result set data or the OUT Parameters.
CpoException
- Thrown if there are errors accessing the datasourcepublic <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> nativeQuery, T result, int queueSize) throws CpoException
CpoAdapter
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.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 returnednativeQuery
- Native query text that will be used to augment the query text stored in
the meta data. This text will be embedded at run-timeresult
- 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.
CpoException
- Thrown if there are errors accessing the datasourcepublic CpoOrderBy newOrderBy(java.lang.String attribute, boolean ascending) throws CpoException
CpoAdapter
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
CpoAdapter
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
CpoAdapter
newWhere
in interface CpoAdapter
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value) throws CpoException
CpoAdapter
newWhere
in interface CpoAdapter
logical
- DOCUMENT ME!attr
- DOCUMENT ME!comp
- DOCUMENT ME!value
- DOCUMENT ME!
CpoException
- Thrown if there are errors accessing the datasourcepublic <T> CpoWhere newWhere(int logical, java.lang.String attr, int comp, T value, boolean not) throws CpoException
CpoAdapter
newWhere
in interface CpoAdapter
logical
- DOCUMENT ME!attr
- DOCUMENT ME!comp
- DOCUMENT ME!value
- DOCUMENT ME!not
- DOCUMENT ME!
CpoException
- Thrown if there are errors accessing the datasourcepublic void clearMetaClass(java.lang.Object obj) throws CpoException
CpoAdapter
clearMetaClass
in interface CpoAdapter
obj
- The object whose metadata must be cleared
CpoException
- Thrown if there are errors accessing the datasourcepublic void clearMetaClass(java.lang.String className) throws CpoException
CpoAdapter
clearMetaClass
in interface CpoAdapter
className
- The fully qualified class name for the class that needs its
metadata cleared.
CpoException
- Thrown if there are errors accessing the datasourcepublic void clearMetaClass() throws CpoException
CpoAdapter
clearMetaClass
in interface CpoAdapter
CpoException
- Thrown if there are errors accessing the datasourcepublic void clearMetaClass(boolean all) throws CpoException
CpoAdapter
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 datasource@Deprecated public <T> long transactObjects(java.util.Collection<CpoObject<T>> coll) throws CpoException
CpoAdapter
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 datasourcepublic CpoTrxAdapter getCpoTrxAdapter() throws CpoException
CpoAdapter
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |