posted 17 years ago
Hi friends,
I am getting the error of
errorAttempt to serialize a collection that implements a cmr-field. Collections managed by the CMP RDBMS persistence manager may not be passed directly to a remote client.
I am doing one program of cmr.When i try to retrieve values using CMR i am geting the above error
The EJBQL
**@ejb.finder
* query="SELECT OBJECT(a) FROM NeworderSCHEMA as a WHERE a.po_no = ?1"
* signature="java.util.Collection findByPo_noCMR(java.lang.String po_no)"
*
The code using to get the values
/**
*
* <!-- begin-xdoclet-definition -->
* @ejb.interface-method view-type="remote"
* <!-- end-xdoclet-definition -->
* @generated
*
*
*/
public java.util.Collection getAllPendingOrdersnew()
throws javax.naming.NamingException, javax.ejb.FinderException {
java.util.Collection pendorders = new java.util.ArrayList(); //to return all pending orders to web-client
java.util.ArrayList pendorder = null; //to put one pending order attributes to collection of pendorders
NeworderLocalHome home = NeworderUtil.getLocalHome();
NeworderLocal localObject = null;
java.util.Collection c = home.findByPo_noCMR("91");
//loop to take one pendingorderLocal at a time and populate pedningorders collection
for(java.util.Iterator i = c.iterator(); i.hasNext(); ){
//populating the arraylist with customer attributes
localObject = (NeworderLocal) i.next();
pendorder = new java.util.ArrayList();
pendorder.add(localObject.getPrimaryKey()); //index 0 -- stores the po_no
pendorder.add(localObject.getPo_date()); //index 1 -- stores the po_date
pendorder.add(localObject.getPo_status());//index 2 -- stores the po_status
pendorder.add(localObject.getPo_suppcode()); //index 3 -- stores the supplier code
pendorder.add(localObject.getUserid());//index 4 -- stores the user id
pendorder.add(localObject.getTimestamp());//index 5 -- stores the created date
pendorder.add(localObject.getItems());//for order detail table
//one customer data is filled. so, add this to customers arraylist
pendorders.add(pendorder);
}
//return the collection of all customers
return pendorders;
}