openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uden <>
Subject Question regarding cascade attribute
Date Thu, 08 May 2008 10:40:56 GMT

We expected that with a @OneToMany(cascade = cascadeType.ALL) relation, we
only had to persist the object that 'owns' the relation (Order in the
example below) to save the objects on both sides of the relation.

We noticed however that from all objects in the Set, only one was persisted.

Is this a bug or are we doing something wrong?


Example 1:
Class Order {

@OneToMany(cascade = cascadeType.ALL)
Set<OrderLine> orderlines;


Class OrderLine { ... }

This Class hierarchy results in three database tables: ORDER, ORDERLINE and
ORDER_ORDERLINE. When we create and persist an Order, add three OrderLines
and merge (update) the Order, only one OrderLine can be found in the
We use OpenJPA 1.0.2 and Derby

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message