* @return a memory instance
*/
public Object newInstance(Object oid, ConnectionHolder context) throws PersistenceException {
if (!(oid instanceof PName))
throw new PersistenceException("Unmanaged object identifier: " + oid);
PName pn = (PName) oid;
String className = null;
try {
pn = pn.resolve(context);
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "newInstance(" + oid + "): pn.resolve=" + pn);
logger.log(BasicLevel.DEBUG, "newInstance(" + oid + "): pn.type=" + pn.getPType());
}
PType type = pn.getPType();
if (type == null) {
//Error detected by Roland Hedayat
throw new PersistenceException("newInstance() "
+ "\n\toid=" + oid
+ "\n\tpn=" + pn
+ "\n\tpn.pnc=" + (pn.getPNameManager() != null ? pn.getPNameManager() : null));
}
className = type.getJormName();
int idx = className.indexOf(JormPathHelper.SEP);
PClassMapping pcm = ((PBinder) pn.getPNameManager())
.getBinderClassMapping();
PersistentObjectItf sp = null;
if ((pcm instanceof AbstractGenClassHome) && idx != -1) {
// This is a Generic class
className = getGCClassName(className.substring(0, idx));