Closed CazacuRadu closed 5 years ago
If you read the @OneToOne
article carefully, you'll see that the @GeneratedValue
is not needed when sharing the PK, meaning you are using the @MapsId
annotation. The UnidirectionalOneToOneTest
does not use @MapsId
, hence you still need @GeneratedValue
.
@vladmihalcea Check the UnidirectionalOneToOne test, you have there the @GeneratedValue even tho in your article you said it should be left out.