@SuppressWarnings({ "unchecked", "rawtypes" })
private Object loadIfNeed(Object o) {
final ORecord record = (ORecord) o;
if (record.getRecord().getInternalStatus() == ORecordElement.STATUS.NOT_LOADED) {
try {
o = record.<ORecord> load();
} catch (ORecordNotFoundException e) {
throw new OException("Error during loading record with id : " + record.getIdentity());
}
}
return o;