// MAKING SURE THAT DATABASE USER IS CURRENT (IN CASE OF DETACHING)
if (iRecord.getDatabase() != underlying)
iRecord.setDatabase(underlying);
if (iRecord.getInternalStatus() == ORecordElement.STATUS.NOT_LOADED)
record = (ODocument) record.load();
pojo = newInstance(record.getClassName());
registerPojo(pojo, record);
stream2pojo(record, pojo, iFetchPlan);