-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow null @Embedded Objects #42
Comments
@glassfishrobot Commented |
@glassfishrobot Commented The JDO spec provided a definition for this problem. "null-indicator-column" defines which column used by the embedded object is for determining a null object, and "null-indicator-value" defines the value in that column that means we have a null object. So then the JPA provider can persist this null value in the null column on persist of a null embedded object, and ditto when retrieving. |
@glassfishrobot Commented |
|
This is an old and low priority issue. I suggest just closing this to reduce clutter (just to be clear I filed this some years ago when frankly time and resources were more abundant). Reza Rahman Please note views expressed here are my own as an individual community member and do not reflect the views of my employer. |
I think this situation should be a |
So, the interesting thing going on here is that the issue description is a bit wrong, it seems to me. It's not the case that JPA doesn't allow an Now, in Hibernate, we say that if all columns mapped by an But it's quite likely that other JPA implementations behave differently here, and so perhaps there's a portability issue that's worth addressing. |
How about, if the |
I don't understand what you mean here. |
Sorry I re-read the OP, the OP wants to have it nullable. But the scenario I am thinking of was to make it explicitly not nullable. What I was alluding to was
would never have |
I see. My knee-jerk reaction was that's a weird solution but it's growing on me. It's an interesting idea, actually. 🤔 |
At the moment, it is not possible to have null @Embedded objects in JPA (while Hibernate, etc allow it). This is quite a common scenario in most domain models that JPA should take into account. The following is an example:
The text was updated successfully, but these errors were encountered: