initializeList(initializer, listRetrieval.executeQuery());
break;
}
Object value = getValueFromRs(rs);
if (":isDeleted".equals(field)){
throw new ObjectNotFoundException(this,objectId);
}
if ("parent".equals(field)){
if(value instanceof ObjectId)
initializer.setParent((ObjectId) value);
else
initializer.setParent((ObjectId) DataSourceManager.getRootObject().getId());
parentSet = true;
}
else if (!":exists".equals(field)){
int type = rs.getInt("value_type");
initializer.setProperty(field, value, (type & DONTENUM) == DONTENUM ? ScriptableObject.DONTENUM : 0);
}
}
rs.close();
if(!hasProperties){
// if no properties were found that means the object doesn't exist
throw new ObjectNotFoundException(this,objectId);
}
if(!parentSet && (id.equals("Object") || id.equals("Array"))){
List<ObjectId> referrers = getReferrers(objectId);
if (!referrers.isEmpty())
initializer.setParent(referrers.get(0));