if (mapping == null) {
final String[] split = id.split("@");
final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(split[0].substring(1));
final Object pojo = spec.createObject(CreationMode.NO_INITIALIZE);
final String oidData = split[1];
final SerialOid oid = SerialOid.createTransient(Long.valueOf(oidData, 16).longValue());
return IsisContext.getPersistenceSession().recreateAdapter(oid, pojo);
}
final ObjectAdapter mappedTransientObject = mapping.getObject();
LOG.debug("retrieved " + mappedTransientObject.getOid() + " for " + id);
return mappedTransientObject;
} else {
final String[] split = id.split("@");
final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(split[0].substring(1));
try {
final String oidData = split[1];
LOG.debug("decoding " + oidData);
ObjectAdapter loadObject;
Oid oid;
// HACK - to remove after fix!
if (oidType == null) {
oidType = IsisContext.getPersistenceSession().getServices().get(0).getOid().getClass();
}
if (split.length > 2) {
final SerialOid parentOid = SerialOid.createPersistent(Long.parseLong(oidData, 16));
oid = new AggregatedOid(parentOid, split[2]);
IsisContext.getPersistenceSession().loadObject(parentOid, spec);
loadObject = IsisContext.getPersistenceSession().getAdapterManager().getAdapterFor(oid);
} else if (oidType.isAssignableFrom(SerialOid.class)) {
oid = SerialOid.createPersistent(Long.parseLong(oidData, 16));