public ObjectAdapter getObjectAndMapIfRequired(final Oid oid) {
final Object pojo = getObjectInstances().get(oid);
if (pojo == null) {
return null;
}
final ObjectAdapter adapterLookedUpByPojo = getAdapterManager().getAdapterFor(pojo);
if (adapterLookedUpByPojo != null) {
return adapterLookedUpByPojo;
}
final ObjectAdapter adapterLookedUpByOid = getAdapterManager().getAdapterFor(oid);
if (adapterLookedUpByOid != null) {
return adapterLookedUpByOid;
}
return getPersistenceSession().mapRecreatedPojo(oid, pojo);
}