Fix su import from parent identity
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user