add mappedById to @ManyToOne and @OneToOne#973
add mappedById to @ManyToOne and @OneToOne#973gavinking wants to merge 3 commits intojakartaee:mainfrom
Conversation
|
Thoughts, @sebersole? @njr-11? |
Co-authored-by: Nathan Rauh <[email protected]>
sebersole
left a comment
There was a problem hiding this comment.
I like it. Left a comment about changes to the javadoc for mappedBy for consideration, but otherwise +1
| /** | ||
| * The field that owns the relationship. Required unless | ||
| * the relationship is unidirectional. | ||
| /** |
There was a problem hiding this comment.
mappedBy serves 2 purposes and I think it makes sense to discuss both of them here. This is a great discussion about the runtime implication in terms of ownership.
But it also defines semantics of the foreign-key - look "there" for it. And in the case of one-to-one actually defines the key side versus the target side of the foreign-key. That's perhaps obvious to us by the term "inverse" but is that generally understood? Not sure.
Same comment for mapedBy on @OneToMany and @OneToOne.
|
@sebersole and I discussed this today, and decided to put it on ice for now. We might reconsider it for 4.1 or whatever. |
For consideration. Competes with #958.
see #527