| Peter Gafert, The problem comes from the fact that FakeBidirectionalRelationWorkUnit#generateData() invokes the relation mapper's mapToMapFromEntity() method where the following block of code is seen, include ToOneIdMapper.
delegate.mapToMapFromEntity( newData, nonInsertableFake ? oldObj : newObj );
I see in FakeBidirectionalRelationWorkUnit we're providing oldObj as null and because this is a non-insertable fake relation, the value added for uniqueGroup_id will always be null as your test case confirms. Reverting the above logic back to old behavior:
delegate.mapToMapFromEntity( newData, newObj );
This is the code used prior to adding support for @AuditMappedBy and this bypasses the issue but I'm not convinced that is the correct route yet. |