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.
In the case of a many-to-many relationship referring to only one table 1. table category ----------------- id name ... 2. table cat_relation --------------------- id (refers to category->id) parent_id (refers to category->id) there will be 2 identical fields generated in the ejb @ManyToMany private Collection<Category> categoryCollection; @ManyToMany(mappedBy = "categoryCollection") private Collection<Category> categoryCollection; Netbeans 5.5.1 handled this by adding an index to the following fields (categoryCollection1,categoryCollection2 etc)
Sorry, I can't reproduce this. When CAT_RELATION.ID was a primary key, this is what was generated: @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId") private Collection<CatRelation> catRelationCollection; @OneToOne(cascade = CascadeType.ALL, mappedBy = "category") private CatRelation catRelation; When it was not a primary key, the following was generated: @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId") private Collection<CatRelation> catRelationCollection; @OneToMany(cascade = CascadeType.ALL, mappedBy = "id") private Collection<CatRelation> catRelationCollection1; Please attach a simple schemas that you can reproduce the issue with in NetBeans 6.0. Thanks.
Created attachment 53889 [details] SQL script for reproducing the issue
Reproducible using the attached SQL script, and it is indeed a regression (5.5 behaves as stated by reporter in desc1).
Fixed. Checking in src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEjbGenerator.java; /cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEjbGenerator.java,v <-- DbSchemaEjbGenerator.java new revision: 1.10; previous revision: 1.9 done
Reporter, can you please verify the bug in the latest daily build? Thanks
verified. correct fields are generated - separated by an index NetBeans IDE Dev (Build 200801310006)
The fix has been ported into the release601_fixes branch. Checking in DbSchemaEjbGenerator.java; /cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/Attic/DbSchemaEjbGenerator.java,v <-- DbSchemaEjbGenerator.java new revision: 1.9.10.1; previous revision: 1.9 done