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.
- Use wizard 'New Entity Classes from Database', select java db sample database - Generate JPA classes by select all tables - Note that all relationship fields have duplicate such as 'productCode' and 'productCode1'. - Deploying application will cause validation error like: Exception [TOPLINK-48] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DescriptorException Exception Description: Multiple writable mappings exist for the field [PRODUCT.PRODUCT_CODE]. Only one may be defined as writable, all others must be specified read-only. Mapping: oracle.toplink.essentials.mappings.OneToOneMapping[productCode1]
Note that I am using almost current code.
Could please specify the OS you're using and the exact build version? I wasn't able to reproduce this with M8 on Linux nor with the latest daily build (200709041800), but with the latter there are other problems (issue 100213). Are there any exceptions in the log file?
I am on WinXP, using JDK 1.6. Note that I checked out java cvs module using tag release60-m8 to get around issue 99900. (remove keyword after providing details, please add back if more details needed)
Created attachment 40697 [details] entity beans generation log
Still be able to reproduce this with latest code. So this seems to be independent of issue 100213.
I don't know how my javadb sample database get *all* foreign key constraints duplicated. Anyway, dropping the duplicate constraints solve the duplicate relationship fields problem. As nobody else experience the weird symptom as I did, I just close this issue as INVALID.
I had the same problem and I found out that somehow I had duplicate foreign keys created (possibly by having the Table Generation Strategy of my Persistence Unit set to Create at some point) and the wizard generated duplicate fields on my entity bean. I fixed the duplicate foreign keys in my database, recaptured the database schema from Netbeans and everything was OK from then on.