The bug is identical to HHH-10583, but affects all relations.
If I rename the property in the other side of the relationship and update the mappeBy value, the error goes away.
I also tried it against those SNAPSHOT versions:
You're right @Ashok, I was trying a few combinations to reproduce the error and I sent the wrong code.
I uploaded two new test cases.
In the unsuccessful one, I did this mapping:
I changed the mapping of the successful one to:
Renaming the variable team to team1 was enough to avoid this error. It only happens when there're a OneToOne and a OneToMany relationship mapping to the same name.
there is an error on your pom.xml. The version of the maven plugin should be the same as for other hibernate artifacts. In particular, when I use a version where is fix (currently only 5.2.1 is released, but there are snapshots available on 5.0 and 5.1 branches) your UnsuccessfulTestCase passes.
That's weird @Luis Barreiro, I had tried the 3 snapshots versions before (like I said in this issue report) and it didn't work.
I redownloaded the unsuccessful test case I have uploaded, I changed the hibernate version to both 5.1.1-SNAPSHOT and 5.2.1-SNAPSHOT, and the error still happens.
All I did was add the jboss snapshot repository:
And change version.org.hibernate:
Am I missing something?
I'm uploading the unsuccessful test case again with the SNAPSHOT version set.
you are missing one thing, it's the version of the hibernate-maven-plugin. In your latest sample it's still set to 5.0.7.Final.
Please note that you'll need to enable the snapshots for plugins as well:
Now that you mention it, it makes total sense. I don't know why I forgot to update the plugin version.
I tried again and it worked. Thanks and sorry for the trouble..