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.
The feature affected is "Create Persistence Unit / Entity Classes from Database". Album <-> AlbumPhotos <-> Photos An Album has many Photos A Photo can belong in many Albums The IDE cannot automatically create a class for AlbumPhoto unless AlbumPhoto has at least 1 extra field beyond Album PK and Photo Pk. Ie. AlbumPhoto(albumPK,photoPK) -> no class generated AlbumPhoto(albumPK,photoPK,dummy) -> class generated.
This is by intention. The intersection (usually called join) table is used in a relational database to store the relationship between an album and its photos, and between a photo and the albums it is included in. However, in entity classes that information is stored in the Album and Photos entity classes themselves, there is no need for a class corresponding to the join table. There should be methods Album.getPhotos() and Photos.getAlbum() returning collection of instances of Photos and Albums, respectively.
It is not invalid. The option whether to create an intersection class should be optional. What if I extend my schema later to include a field on the intersection table? I would have to modify a potential huge amount of code to accomodate the new intersection table to process the new intersection entity. If I can choose to have an intersection class from the beginning, I'd only have to accomodate the fields, not an entirely new class. Please add the option! Thanks...
Makes it an enhancement then. It also seems to me this kind of goes against the spec. Any evidence proving that people prefer to generate classes for join tables would be helpful.
Obsolete milestone, please reevaluate
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss