[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[eclipselink-users] Problem with ManyToMany mapping
|
- From: "Mohsen Saboorian" <mohsens@xxxxxxxxx>
- Date: Thu, 26 Jun 2008 19:31:17 +0330
- Delivered-to: eclipselink-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=xEGfkMclu5HSSNfN2lGhkIBQhfG6evv97czJMC21juI=; b=LCHS6OgEf+7mPh/bDUZWODr19iugZQ8xUjjUxFpVSIH1MldjNxEmLqrkcuionntTTi ghuCzokgcp/lkrdpxl7vq9ntsuF0w9+sP6sP84exMq2u/AHrXpEcGhlRigHibiplZ4k0 QbeT4E/p3qVjwehHWmLpQXATSrfqBb+GCZm2k=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Ca/XL2KGwadWS5TOrtu5Zo3sEB6mFBZ4lEQYNLrzM3LdDOkAd0lFeaScBJbdamkAbc LzV3lxV35yswxbjlAqbdz4EeWaFY1kwIRHTC1nMBA8n+tr/U9vyQmPdYQOhf2aXzVcui 7SkVG0G+d9OSF169tsx4U06VuZaZG3KUybaAM=
Hi,
I have a @ManyToMany mapping from a entity to itself. Since there is
no property for the relation, I just used a @JoinTable along with
@ManyToMany. The problem is updateing. Suppose I have A <=> B. Inside
a transaction, I remove A-B relation, from both owning sides, and
again set a reference to B in A ref list and vice versa. Normally
EclipseLink should do nothing, since the A-B relation is again created
(inside tx), but I'm getting unique constraint violation, since
EclipseLink tries to insert another relation between A and B, in
addition to the one already exists.
Is this a problem with JPA 1.0 spec, or my updating scenario is wrong?
What is the best way to update ManyToMay without having an independent
intermediate entity?
Thanks,
Mohsen.