openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Chauvet (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (OPENJPA-2363) Multiple collections with same class type in a single entity : clear() delete shared entities from collections.
Date Wed, 09 Oct 2013 12:18:41 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Guillaume Chauvet resolved OPENJPA-2363.
----------------------------------------

    Resolution: Not A Problem

Just need to use JoinTable annotation with different table name for each OneToMany. See below
:

@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "ANSWERS")
private List<EntityB> answers = new LinkedList<EntityB>();
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "TARGETS")
private List<EntityB> targets = new LinkedList<EntityB>();
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "RESULTS")
private List<EntityB> results = new LinkedList<EntityB>();

> Multiple collections with same class type in a single entity : clear() delete shared
entities from collections.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2363
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2363
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>            Reporter: Guillaume Chauvet
>         Attachments: OPENJPA-2363.zip
>
>
> Please find attached a draft including a unitary test that reproduce the problem exposed
on nabble [1].
> [1] http://openjpa.208410.n2.nabble.com/Collections-with-same-class-type-in-a-entity-deleted-after-update-transaction-td7583212.html



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message