I had put a fix for this issue recently OPENJPA-935. Will the original reporter please verify?
OpenJPA makes a decision during bulk delete whether the delete operation involves a single table only. That decision was not accounting for cascade behavior for embedded fields. [1] http://issues.apache.org/jira/browse/OPENJPA-935 Jeremy Bauer wrote: > > Hi Marcin, > > I observe the same behavior when the base entity contains an embeddable. > Without an embeddable, the provider issues a single delete (as expected). > Since OpenJPA is operating on a single table, I don't see why multiple > deletes are necessary. Unless I'm missing something, this appears to be a > bug in the provider. Please open a JIRA. > > -Jeremy > > On Thu, Feb 19, 2009 at 6:37 AM, <[email protected]> wrote: > >> Hi, >> >> I have a following beans: >> >> @Embeddable >> class A { >> int field1 >> } >> >> @Entity >> class B { >> @Id >> long id; >> >> int field2 >> >> @Embedded >> A field3 >> } >> >> When I trying to delete all instances of B entity from data storage by >> "delete from B" I got: >> >> 1. Query ("select" statement) for all B instances >> 2. For each instance from 1. delete statement >> >> Why this is not delete by simple "delete from B" sql statement? >> >> Regards, >> Marcin >> > > -- View this message in context: http://n2.nabble.com/Removing-entity-with-Embedded-field-tp2354162p2374113.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
