-
Notifications
You must be signed in to change notification settings - Fork 67
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
Support embeddable object with 1-N (non-relation) field with join table #138
Labels
Milestone
Comments
andyjefferson
added a commit
that referenced
this issue
Nov 11, 2016
the field number since the metadata is incorrect. For #138
andyjefferson
added a commit
that referenced
this issue
Nov 11, 2016
Still needs tests adding, and either cater for multiple points of embedding, or raise separate issue for that |
See #139 for the ability to embed in multiple owners. |
andyjefferson
added a commit
that referenced
this issue
Nov 18, 2016
andyjefferson
added a commit
that referenced
this issue
Dec 6, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If we have an embedded object and that object has a 1-N field (either relation, or Collection of some basic type) this implies having a join table for the related object(s). The join table needs a FK back to the owner, but in this case the owner object has no such 'id' and would have to navigate back to the owner that it is embedded in. This is not currently fully supported, but we could one day. See also http://www.datanucleus.org/servlet/jira/browse/NUCRDBMS-989
Need to consider the following situation also.
@PersistenceCapable
@table(name="TABLE_A")
class A
{
@PrimaryKey
long id;
}
@PersistenceCapable
class B
{
String name;
}
If class B is "embeddedOnly" then we will have TABLE_A and TABLE_B_VALUES.
If class B is not "embeddedOnly" then we will have TABLE_A, TABLE_B, TABLE_B_VALUES and the owner mapping of TABLE_B_VALUES will be confused because it needs datastore-id when used from owner B, and application-id (long) when used from owner A (with B embedded into A).
The text was updated successfully, but these errors were encountered: