DATAJDBC-251 - Back-reference for dependent entity gets properly set.
If a parent DbAction does not offer a generated id, the id of the entity is used instead. This behavior was broken by DATAJDBC-241. Related tickets: DATAJDBC-241. Original pull request: #85.
This commit is contained in:
committed by
Oliver Gierke
parent
d158cd062d
commit
55c901b43b
@@ -171,7 +171,12 @@ class DefaultJdbcInterpreter implements Interpreter {
|
||||
Object entity = dependingOn.getEntity();
|
||||
|
||||
if (dependingOn instanceof DbAction.WithGeneratedId) {
|
||||
return ((DbAction.WithGeneratedId<?>) dependingOn).getGeneratedId();
|
||||
|
||||
Object generatedId = ((DbAction.WithGeneratedId<?>) dependingOn).getGeneratedId();
|
||||
|
||||
if (generatedId != null) {
|
||||
return generatedId;
|
||||
}
|
||||
}
|
||||
|
||||
return persistentEntity.getIdentifierAccessor(entity).getIdentifier();
|
||||
|
||||
Reference in New Issue
Block a user