In my setup I have an unidirectional one-to-one relation from Person -> Address in the attach test case. The Person has @EmbeddedId which one of it's id's should be cascaded to the Address id.
When I map a @OneToOne relation with @Mapsid with the purpose of cascade the primary key it throw an exception.
If I have read the JPA 2.1 specification correctly it should be supported?
I have attached test in the `ORMUnitTestCase` file
Thanks for the feedback,
I don't know what I can add more than the test case I already have attached and fails with 5.2.2. And I can confirm I have the same issue with 5.2.9 with the same test case
Okay, thanks! I will keep trying to work on this. Could you possible attach a pom.xml file just in case our dependencies aren't exactly the same? Thanks!
I was able to get your test running and working after changing your String ids to longs and using a generated value strategy auto for address id. Currently working on test cases where this can be improved upon.
As far I understand one of the purpose of @MapsId is you can cascade one of the composite primary keys to a FK. This mean it should not be necessary to define generated strategy for the FK simple because the PK is cascaded.
That what I'm trying to achieve with @MapsId
It seems that in this case, @MapsId is being used in the inverse way and trying to assign the address Id to the person Id. The reason for this is due to Address/Person being flipped as dependent and parent entities (Address would be considered the parent entity in this case). Changing this and manually assigning an Id to address will make it so we don't have to assign a person Id in the embeddable class.