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.

Bug 242442

Summary: Could not be generated a JPA Controller class from an Entity class with methods
Product: javaee Reporter: cagcak
Component: PersistenceAssignee: Sergey Petrov <sj-nb>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:
Attachments: Successfuly generated Entity and Controller Classes by NetBeans
unsuccessfuly generated Entity and Controller Classes by NetBeans
Designs of tables which are releated to the classes

Description cagcak 2014-02-28 10:13:24 UTC
Created attachment 145655 [details]
Successfuly generated Entity and Controller Classes by NetBeans

NetBeans cannot generate a JPA controller class from the entity class by default methods. An error returns 'xxxx.xxxx.Users: could not find id property. Be sure the accessor method name matches the variable name'.
The database table 'USERS' for the Entity class, which is generated by NetBeans, has two fields in VARCHAR type, and one of them is primary key. The other Entity classes, which have id fields in INT property, let NetBeans generates controller classes successfully with default methods. I've attached two controller classes with their entity classes, one is for successfully generated (GeneralInfo.java ---> GeneralInfoJpaController.java), and the other one is that could not be generated (Users.java ---> UsersJpaController.java), and of course the table designs.
Comment 1 cagcak 2014-02-28 10:14:29 UTC
Created attachment 145657 [details]
unsuccessfuly generated Entity and Controller Classes by NetBeans
Comment 2 cagcak 2014-02-28 10:15:55 UTC
Created attachment 145658 [details]
Designs of tables which are releated to the classes