return ret;
}
public DBObject newDBOBbject(PropertyRecord record) {
DBObject ret = new BasicDBObject();
BasicDBList propertyArray = new BasicDBList();
if (record.getId() != null) {
ret.put("_id", record.getId());
}
for (Property<Object> prop : record) {
DBObject jsonProp = new BasicDBObject();
jsonProp.put("name", prop.getName());
jsonProp.put("value", prop.getValue());
if (prop.getCreatorId() != null) {
jsonProp.put("creatorId", prop.getCreatorId());
}
if (prop.getSourceId() != null) {
jsonProp.put("sourceId", prop.getSourceId());
}
if (prop.getImporterId() != null) {
jsonProp.put("importerId", prop.getImporterId());
}
propertyArray.add(jsonProp);
}
ret.put("properties", propertyArray);
Date creationDate = new Date();
ret.put("creationDate", creationDate);
if (record.getCreatorId() != null) {