use of javax.ejb.EJBLocalObject in project Payara by payara.
the class JDOEJB20HelperImpl method convertCollectionEJBLocalObjectToPC.
/**
* Converts Collection of EJBLocalObjects to a Collection of
* persistence-capable instances.
* @param coll the Collection of EJBLocalObject instances to be converted.
* @param pm the associated instance of PersistenceManager.
* @param validate true if the existence of the instances is to be validated.
* @return Collection of persistence-capable instance.
* @throws IllegalArgumentException if validate is true and at least one instance does
* not exist in the database or is deleted.
*/
public Collection convertCollectionEJBLocalObjectToPC(Collection coll, PersistenceManager pm, boolean validate) {
Collection rc = new java.util.ArrayList();
Object o = null;
boolean debug = false;
for (java.util.Iterator it = coll.iterator(); it.hasNext(); ) {
o = convertEJBLocalObjectToPC((EJBLocalObject) it.next(), pm, validate);
if (logger.isLoggable(Logger.FINEST)) {
logger.finest(// NOI18N
"\n---JDOEJB20HelperImpl.convertCollectionEJBLocalObjectToPC() adding: " + o);
}
rc.add(o);
}
return rc;
}
use of javax.ejb.EJBLocalObject in project Payara by payara.
the class JDOEJB20HelperImpl method convertPCToEJBLocalObject.
/**
* Converts persistence-capable instance to EJBLocalObject.
* @param pc the persistence-capable instance to be converted as an Object.
* @param pm the associated instance of PersistenceManager.
* @return instance of EJBLocalObject.
*/
public EJBLocalObject convertPCToEJBLocalObject(Object pc, PersistenceManager pm) {
if (pc == null)
return null;
Object jdoObjectId = pm.getObjectId(pc);
Object key = convertObjectIdToPrimaryKey(jdoObjectId);
try {
return CMPHelper.getEJBLocalObject(key, getContainer());
} catch (Exception ex) {
EJBException e = new EJBException(I18NHelper.getMessage(messages, "EXC_ConvertPCToEJBLocalObject", key.toString()), // NOI18N
ex);
// NOI18N
logger.throwing("JDOEJB20HelperImpl", "convertPCToEJBLocalObject", e);
throw e;
}
}
Aggregations