Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Check in Bug 289469 - Embedded many-to-many fails on persist, find and ddl generation

https://bugs.eclipse.org/bugs/show_bug.cgi?id=289469

Embedded Mappings that contain relationships are not properly read from the
database.

The issue is that we decide whether to create a null aggregate or an aggregate
that contains mappings by looking at the fields returned in the query for the
owning object.

If a relationship mapping is present in the Embedded that either uses a Target
Foreign Key or a join table, the query for the initial object will not have any
fields for that relationship.  As a result, if, for instance, an Embeddable has
only that kind of relationship mapping, it is impossible for us to tell if the
Embeddable should be null or if it has mappings without reading the target.

The JPA spec takes no position on the lifecylce of embeddables, and we have
decided that Embeddables with relationships cannot be set to null.

The attached patch makes the changes above, as well as making DDL generation
work properly for embeddables.

Reviewed by Chris Delahunt

Added tests to DDL Generation test model


Back to the top