Given entities: Device, DeviceClientId, DeviceServerId, DevPart Where Device has mappings to the two Device_Xxx_Id entities as:
And DevPart is mapped as:
Both The Device_Xxx_Id entities map the Device as:
@OneToOne(targetEntity = Device.class, fetch = FetchType.EAGER)
@JoinColumn(name = "DEVICE_FK", nullable = false)
private Device device;
if hibernate.max_fetch_depth = 1, then a query of the devices results in the clientId and the serverId being null. even though it executes a query for the both the client a server ids. The attached test case outputs the following error:
Prior to that, it executes sql to get the clientID and does extract data:
but never sets it on the Device. If hibernate.max_fetch_depth is set to 2, then this works. This used to work in 5.3.28. Also, for some reason, if I remove the DevPart class and mapping entirely, the test again fails to load the DevClientID and DevServerID into the Device, but this time it fails regardless of the {{hibernate.max_fetch_depth }}value. |