It appears that this in an OpenJPA bug. Could I have you open a JIRA for
this issue and attach your testcase?
I'm not sure when I'll get time to try to fix this issue, but for the short
term you have a couple workaround options....Option #1 -- you could change
your ID generation strategy to AUTO[1]. Option #2 -- don't rely on the
cascade persist functionality. Manually persist each of your children
objects (Class1, Class2) before persisting Holder[2].
Thanks,
Rick
[1]
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
[2]
class HolderDao ....
public boolean create(Holder h) {
EntityTransaction trans = em.getTransaction();
trans.begin();
for (IInterface i : h.getClasses()) {
em.persist(i);
}
em.persist(h);
trans.commit();
return true;
}
On Thu, Apr 26, 2012 at 10:14 AM, CarpathianAnonymous <
[email protected]> wrote:
> I've attached my UnitTest
>
> http://openjpa.208410.n2.nabble.com/file/n7503208/src.rar src.rar
>
> --
>
--
*Rick Curtis*