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 253443

Summary: Wrong owning side of manytomany relationship via "Entity classes from database"
Product: javaee Reporter: manu206
Component: PersistenceAssignee: Sergey Petrov <sj-nb>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description manu206 2015-07-13 16:06:33 UTC
I'm using jpa with netbeans "Entity classes from database" function to generate my entity classes. Sadly, netbeans chooses the wrong manytomany relationship owner. I have for example a user and group table which are related via many to many. In my case the group entity is the owner with @JoinTable and User has the "MappedBy" annotation. How can I make User to the owning entity. I could change it manually but after generating it again from database, it will be overwritten. This is really annoying. Any ideas?

My n:m table has userId as first column and groupId as second. I assumed that this order will determine owning side?!?