Tables without primarys key?
"janpla" <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a question I have asked before, but I thought I would ask it again, in a slightly different way: Is there any good reason why NetBeans does not allow you to create entity classes from tables without a primary key? I am talking from the perspective of J2EE, and by good reason I mean a reason that is purely technical, not one that contains references to what is considered good practice. I have a had a search on the net, and the discussions always seem to become something about "why would you create a table without a primary key when it is so easy?" - I would contest that such a question is misplaced, since many developers have to work with existing databases over which they have no design power, and which are simply made that way, be it good or bad. I tend to agree, that if I design a table, then a primary key would be a natural thing to add, but sometimes I don't have a choice. Seeing how I can write an entity class from scratch, which will work perfectly well with JPA, I can't see why it isn't possible to simply have NetBeans generate the same, whether there is a primary key or not. So, is there a good reason?