org.synchronoss.cpo
Class CpoObject<T>
java.lang.Object
org.synchronoss.cpo.CpoObject<T>
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
Deprecated.
@Deprecated
public class CpoObject<T>
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Cloneable
CpoObject is used in conjunction with the transactObjects to perform a
transactions without having to deal with commit, or rollback.
A series of CpoObjects are defined and stored in a collection and then the collection
is passed into transactObjects
.
This Object has been deprecated. Use a CpoTrxAdapter to manage transactions.
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{
} catch (CpoException ce) {
}
}
- Author:
- david berry
- See Also:
- Serialized Form
Constructor Summary |
CpoObject(int operation,
java.lang.String name,
T object)
Deprecated. |
Method Summary |
java.lang.String |
getName()
Deprecated. Gets the context name that will be used to identify the query group that is associated with
the operation on the specific object |
T |
getObject()
Deprecated. Gets the object that was passed in when creating this CpoObject. |
int |
getOperation()
Deprecated. Gets the integer that represents the type of operation that will be
called on the pojo |
protected void |
setName(java.lang.String name)
Deprecated. |
protected void |
setObject(T object)
Deprecated. |
protected void |
setOperation(int operation)
Deprecated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CpoObject
public CpoObject(int operation,
java.lang.String name,
T object)
- Deprecated.
- Parameters:
operation
- One of the following constants
CpoAdapter.CREATE - performs an insertObject
as part of a bigger transaction
CpoAdapter.INSERT - performs an insertObject
as part of a bigger transaction
CpoAdapter.UPDATE - performs an updateObject
as part of a bigger transaction
CpoAdapter.DELETE - performs an deleteObject
as part of a bigger transaction
CpoAdapter.RETRIEVE - performs a retrieveObject
as part of a bigger transaction
CpoAdapter.LIST - performs an retrieveObjects
as part of a bigger transaction
CpoAdapter.PERSIST - performs a persistObject
as part of a bigger transaction
CpoAdapter.EXIST - performs an existsObject
as part of a bigger transaction
CpoAdapter.EXECUTE - performs an executeObject
as part of a bigger transactionname
- - The context name of that identifies the query group associated with the operation.object
- - The populated object for which CPO will be called.
setOperation
protected void setOperation(int operation)
- Deprecated.
setName
protected void setName(java.lang.String name)
- Deprecated.
setObject
protected void setObject(T object)
- Deprecated.
getOperation
public int getOperation()
- Deprecated.
- Gets the integer that represents the type of operation that will be
called on the pojo
- Returns:
- One of the following:
CpoAdapter.CREATE - performs an
insertObject
as part of a bigger transaction
CpoAdapter.INSERT - performs an insertObject
as part of a bigger transaction
CpoAdapter.UPDATE - performs an updateObject
as part of a bigger transaction
CpoAdapter.DELETE - performs an deleteObject
as part of a bigger transaction
CpoAdapter.RETRIEVE - performs a retrieveObject
as part of a bigger transaction
CpoAdapter.LIST - performs an retrieveObjects
as part of a bigger transaction
CpoAdapter.PERSIST - performs a persistObject
as part of a bigger transaction
CpoAdapter.EXIST - performs an existsObject
as part of a bigger transaction
CpoAdapter.EXECUTE - performs an executeObject
as part of a bigger transaction
getName
public java.lang.String getName()
- Deprecated.
- Gets the context name that will be used to identify the query group that is associated with
the operation on the specific object
- Returns:
- The context name
getObject
public T getObject()
- Deprecated.
- Gets the object that was passed in when creating this CpoObject.
- Returns:
- The populated object for which CPO will be called.
Copyright © 2009. All Rights Reserved.