This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 82991 - [verification] Assure correct designation of the owning and inverse sides in relationship annotations
Summary: [verification] Assure correct designation of the owning and inverse sides in ...
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: Editor (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-18 14:42 UTC by Tomasz Slota
Modified: 2006-08-18 14:44 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Slota 2006-08-18 14:42:39 UTC
We should detect following situations that cause deployment error:

-- 1
@Entity class A{
   @ManyToMany(mappedBy="as") List<B> bs;
}

@Entity class B{
   @ManyToMany(mappedBy="bs") List<A> as;
}

-- 2
@Entity class A{
   @ManyToMany List<B> bs;
}

@Entity class B{
   @ManyToMany List<A> as;
}

'mappedBy' should be used exactly once. The same applies for OneToOne annotation.

See issue 82571 for additional info.

Corresponding hints should allow adding or removing the 'mappedBy' attribute, depending on 
situation.