Finish Hotfix-54

This commit is contained in:
2024-03-19 16:02:35 +01:00

View File

@@ -1544,7 +1544,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
Field identityField = identityOptionalField.get();
identityField.setAccessible(true);
SqlField sqlObject = identityField.getAnnotation(SqlField.class);
//SqlField sqlObject = identityField.getAnnotation(SqlField.class);
List<Field> entityChildFields = Stream.of(fields).filter(x -> x.isAnnotationPresent(EntityChild.class)).toList();
@@ -1556,11 +1556,11 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
if (entityChildFieldObject instanceof List) {
List<EntityBase> list = ((List<EntityBase>) entityChildFieldObject);
for (EntityBase child : list) {
child.setParentIdentityIfExists(sqlObject.value(), (Long) identityField.get(this));
child.setParentIdentityIfExists(identityField.getName(), (Long) identityField.get(this));
}
} else {
EntityBase child = ((EntityBase) entityChildFieldObject);
child.setParentIdentityIfExists(sqlObject.value(), (Long) identityField.get(this));
child.setParentIdentityIfExists(identityField.getName(), (Long) identityField.get(this));
}
}
}