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.
build 200603200300 -open/create EJB module -create beans from sample db -ERROR generated relationships has wrong names (e.g. "null-1")
of course this is for J2EE 1.4 version of EJB module
Fixed hopefully. Pavel or Rochelle, could you please review? Thanks. Checking in src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEjbGenerator.java; /cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/Attic/DbSchemaEjbGenerator.java,v <-- DbSchemaEjbGenerator.java new revision: 1.1.2.1.2.10; previous revision: 1.1.2.1.2.9 done
*** Issue 75757 has been marked as a duplicate of this issue. ***
Andrei - behavior looks okay. My only concern is the difference b/w this code and the other setRelationName call in the method makeRelationsUnique. Should that code be factored?
It seems to me the difference is there because the calls do something different. The setRelationName() call I added sets the name of a 1:N relationship (there is yet another call in addJoinTable() setting the name of a N:M relationship). But the call in makeRelationsUnique() has a different meaning - it just adds numbers to duplicate names in order to ensure unique names. So I don't see a need to refactor. Unless I'm missing something, of course.
Yes, I agree they are probably different. My 2 thoughts were: 1) Is it possible that this one might also need a uniquing check in some strange case? 2) The use of "-" with the 2 names - if we foresee changing this in any way (or doing something special for i18n) then we would need to do it in 2 places instead of just one.
Re. 1: the uniquing check is done at the end of buildMPSet(), it doesn't seem to need to be done explicitly. Re. 2: This doesn't sound likely, and moreover, the '-' in the code I added could be even regarded as different from the '-' in makeRelationsUnique(). For the uniquing algorithm we can decide to use something else and still use the dash as the entity name separator, like in "PersonBean-AddressBean#1" (OK, I don't know if # would be a valid char in this context). Feel free to reopen if you disagree, I can introduce a field for the '-' and use it in both methods. Or perhaps if you have an idea how to refactor the code please describe it here and I can implement it (unless you want to, of course :-)
No need to reopen, just wanted to bring up those points.