use of com.orientechnologies.orient.object.db.OObjectNotDetachedException in project orientdb by orientechnologies.
the class OObjectSerializerHelper method getObjectVersion.
public static int getObjectVersion(final Object iPojo) {
getClassFields(iPojo.getClass());
final Field idField = fieldVersions.get(iPojo.getClass());
if (idField != null) {
final Object ver = getFieldValue(iPojo, idField.getName());
return convertVersion(ver);
}
throw new OObjectNotDetachedException("Cannot retrieve the object's VERSION for '" + iPojo + "' because has not been detached");
}
Aggregations