Object prevObj =one.getPrev();
if(prevObj != null){
Class<?> delClazz = prevObj.getClass();
ClassInfo delInfo = ClassInfo.getClassInfo(delClazz);
Key delKey = GaeMappingUtils.makeKeyFromParent(
delInfo, prevObj, entity.getKey(), info, f);
List<Key> key2Remove = keysMap.get(PersistenceType.DELETE);
if(key2Remove == null){
key2Remove = new ArrayList<Key>();
keysMap.put(PersistenceType.DELETE, key2Remove);
}
key2Remove.add(delKey);
}
// resets modified flag
one.setModified(false);
Object oneObj = one.get();
if(oneObj != null){
_updateBuildMaps(entitiesMap, objectsMap, keysMap, oneObj, entity.getKey(), info, f);
}
}
}
else if(ClassInfo.isMany(f)){
Many4PM<?> lq = (Many4PM<?>)Util.readField(obj, f);
// do not update all objects, would be crazy :)
// UPDATE IS THE RESPONSABILITY OF THE CODER
/*if(!lq.asList().isEmpty()){
for(Object elt : lq.asList()){
_buildUpdateList(entities, entities2Remove, objects2Save, elt, entity.getKey(), info, f);
}
}*/
// add to entities2remove child entities that have been removed
if(!lq.asList2Remove().isEmpty()){
Key delKey;
for(Object elt : lq.asList2Remove()){
Class<?> delClazz = elt.getClass();
ClassInfo delInfo = ClassInfo.getClassInfo(delClazz);
delKey = GaeMappingUtils.makeKeyFromParent(