mirror of https://github.com/apache/openjpa.git
OPENJPA-1226: fix merge entities with nested embeddables
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@801052 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
baaec8148b
commit
a4a94f5331
|
@ -118,7 +118,7 @@ public class DetachedStateManager
|
|||
|
||||
// pre-load for efficiency: current field values for restore, dependent
|
||||
// for delete
|
||||
FieldMetaData[] fields = meta.getFields();
|
||||
FieldMetaData[] fields = sm.getMetaData().getFields();
|
||||
int restore = broker.getRestoreState();
|
||||
if (_dirty.length() > 0) {
|
||||
BitSet load = new BitSet(fields.length);
|
||||
|
|
|
@ -146,7 +146,7 @@ class VersionAttachStrategy
|
|||
int detach = (isNew) ? DETACH_ALL : broker.getDetachState();
|
||||
FetchConfiguration fetch = broker.getFetchConfiguration();
|
||||
try {
|
||||
FieldMetaData[] fmds = meta.getFields();
|
||||
FieldMetaData[] fmds = sm.getMetaData().getFields();
|
||||
for (int i = 0; i < fmds.length; i++) {
|
||||
switch (detach) {
|
||||
case DETACH_ALL:
|
||||
|
|
|
@ -897,6 +897,13 @@ public class TestEmbeddable extends SingleEMFTestCase {
|
|||
EntityA_Coll_Embed_Embed a =
|
||||
em.find(EntityA_Coll_Embed_Embed.class, ID);
|
||||
checkEntityA_Coll_Embed_Embed(a);
|
||||
|
||||
em.clear();
|
||||
em.getTransaction().begin();
|
||||
Embed_Embed embed = createEmbed_Embed(em, ID, 100);
|
||||
a.addEmbed(embed);
|
||||
em.merge(a);
|
||||
em.getTransaction().commit();
|
||||
em.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue