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 - Wrong owning side of manytomany relationship via "Entity classes from database"
Summary: Wrong owning side of manytomany relationship via "Entity classes from database"
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-13 16:06 UTC by manu206
Modified: 2015-07-13 16:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?!?