|
|||||||||
| 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. |
|
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(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,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
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,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
Retrieves the Object from the datasource. |
|
|
retrieveObjects(java.lang.String name,
C criteria,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy,
int queueSize)
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.SessionBeanpublic void ejbPassivate()
ejbPassivate in interface javax.ejb.SessionBeanpublic void ejbRemove()
ejbRemove in interface javax.ejb.SessionBeanpublic 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 CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long insertObject(java.lang.String name,
T obj)
throws CpoException
insertObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.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 datasource
public <T> long insertObjects(java.util.Collection<T> coll)
throws CpoException
insertObjects in interface CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long insertObjects(java.lang.String name,
java.util.Collection<T> coll)
throws CpoException
insertObjects in interface CpoAdaptername - 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 datasource
public <T> T retrieveObject(T obj)
throws CpoException
retrieveObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown. If the object does not exist
in the datasource, an exception will be thrown. 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
public <T> T retrieveObject(java.lang.String name,
T obj)
throws CpoException
retrieveObject in interface CpoAdaptername - 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 datasource
public <T,C> T retrieveObject(java.lang.String name,
C criteria,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
throws CpoException
retrieveObject in interface CpoAdaptername - 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.where - The CpoWhere object that defines 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
public <T,C> java.util.Collection<T> retrieveObjects(java.lang.String name,
C criteria,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy)
throws CpoException
retrieveObjects in interface CpoAdaptername - 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.where - The CpoWhere object that defines 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
public <T> long updateObject(T obj)
throws CpoException
updateObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long updateObject(java.lang.String name,
T obj)
throws CpoException
updateObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.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 datasource
public <T> long updateObjects(java.util.Collection<T> coll)
throws CpoException
updateObjects in interface CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long updateObjects(java.lang.String name,
java.util.Collection<T> coll)
throws CpoException
updateObjects in interface CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.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 datasource
public <T> long deleteObject(T obj)
throws CpoException
deleteObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown. If the object does not exist in
the datasource an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long deleteObject(java.lang.String name,
T obj)
throws CpoException
deleteObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown. If the object does not exist in
the datasource an exception will be thrown.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 datasource
public <T> long deleteObjects(java.util.Collection<T> coll)
throws CpoException
deleteObjects in interface CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.
CpoException - Thrown if there are errors accessing the datasource
public <T> long deleteObjects(java.lang.String name,
java.util.Collection<T> coll)
throws CpoException
deleteObjects in interface CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.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 datasource
public <T> long persistObject(T obj)
throws CpoException
persistObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.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 CpoAdaptername - 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 CpoAdaptercoll - This is a collection of objects that have been defined within
the metadata of the datasource. If the class is not defined
an exception will be thrown.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.RemoteExceptionexistsObject(T),
insertObject(T),
updateObject(T)
public <T> long persistObjects(java.lang.String name,
java.util.Collection<T> coll)
throws CpoException
persistObjects in interface CpoAdaptername - 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.RemoteExceptionexistsObject(T),
insertObject(T),
updateObject(T)
public <T> long existsObject(T obj)
throws CpoException
existsObject in interface CpoAdapterobj - This is an object that has been defined within the
metadata of the datasource. If the class is not defined
an exception will be thrown.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 datasource
public <T> long existsObject(java.lang.String name,
T obj)
throws CpoException
existsObject in interface CpoAdaptername - 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 datasource
public <T> T executeObject(T object)
throws CpoException
executeObject in interface CpoAdaptercriteria - 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 datasource
public <T> T executeObject(java.lang.String name,
T object)
throws CpoException
executeObject in interface CpoAdaptername - The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.object - This is an object that has been defined within the metadata of the
datasource. If the class is not defined an exception will be thrown. If the object
does not exist in the datasource, an exception will be thrown. This object is used
to populate the IN parameters used to retrieve the collection of objects.
This object defines the object type that will be returned in the collection and
contain the result set data or the OUT Parameters.
CpoException - DOCUMENT ME!
public <T,C> T executeObject(java.lang.String name,
C criteria,
T result)
throws CpoException
executeObject in interface CpoAdaptername - The filter name which tells the datasource which objects should be
returned. The name also signifies what data in the object will be
populated.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 datasource
public <T,C> CpoResultSet<T> retrieveObjects(java.lang.String name,
C criteria,
T result,
CpoWhere where,
java.util.Collection<CpoOrderBy> orderBy,
int queueSize)
throws CpoException
CpoAdapter
retrieveObjects in interface CpoAdaptername - The filter name which tells the datasource which objects should be returned. The
name also signifies what data in the object will be populated.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.where - The CpoWhere object that defines 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
public CpoOrderBy newOrderBy(java.lang.String attribute,
boolean ascending)
throws CpoException
CpoAdapter
newOrderBy in interface CpoAdapterattribute - The name of the attribute from the pojo that will be sorted.ascending - If true, sort ascending. If false sort descending.
CpoException - Thrown if there are errors accessing the datasource
public CpoOrderBy newOrderBy(java.lang.String attribute,
boolean ascending,
java.lang.String function)
throws CpoException
CpoAdapter
newOrderBy in interface CpoAdapterattribute - The name of the attribute from the pojo that will be sorted.ascending - If true, sort ascending. If false sort descending.function - A string which represents a datasource function that will be called on the attribute.
must be contained in the function string. The attribute name will be replaced at run-time with its
datasource counterpart
CpoException - Thrown if there are errors accessing the datasource
public CpoWhere newWhere()
throws CpoException
CpoAdapter
newWhere in interface CpoAdapterCpoException - Thrown if there are errors accessing the datasource
public <T> CpoWhere newWhere(int logical,
java.lang.String attr,
int comp,
T value)
throws CpoException
CpoAdapter
newWhere in interface CpoAdapterlogical - DOCUMENT ME!attr - DOCUMENT ME!comp - DOCUMENT ME!value - DOCUMENT ME!
CpoException - Thrown if there are errors accessing the datasource
public <T> CpoWhere newWhere(int logical,
java.lang.String attr,
int comp,
T value,
boolean not)
throws CpoException
CpoAdapter
newWhere in interface CpoAdapterlogical - DOCUMENT ME!attr - DOCUMENT ME!comp - DOCUMENT ME!value - DOCUMENT ME!not - DOCUMENT ME!
CpoException - Thrown if there are errors accessing the datasource
public void clearMetaClass(java.lang.Object obj)
throws CpoException
CpoAdapter
clearMetaClass in interface CpoAdapterobj - The object whose metadata must be cleared
CpoException - Thrown if there are errors accessing the datasource
public void clearMetaClass(java.lang.String className)
throws CpoException
CpoAdapter
clearMetaClass in interface CpoAdapterclassName - The fully qualified class name for the class that needs its
metadata cleared.
CpoException - Thrown if there are errors accessing the datasource
public void clearMetaClass()
throws CpoException
CpoAdapter
clearMetaClass in interface CpoAdapterCpoException - Thrown if there are errors accessing the datasource
@Deprecated
public <T> long transactObjects(java.util.Collection<CpoObject<T>> coll)
throws CpoException
CpoAdapterExample:
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 CpoAdaptercoll - 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
public CpoTrxAdapter getCpoTrxAdapter()
throws CpoException
CpoAdapterExample:
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 CpoAdapterCpoException - Thrown if there are errors accessing the datasourceCpoTrxAdapter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||