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 97623

Summary: Heuristic Rules for Code Generation
Product: javaee Reporter: gamelol <gamelol>
Component: PersistenceAssignee: Andrei Badea <abadea>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description gamelol 2007-03-11 06:54:42 UTC
JPA and Entity Classes from Database could use some customization.  For 
example,

Employer(employerOid,name)
Employeee(employerOid,employeeOid,name)

results in 2 classes, Employer and Employee.

Employer Employee.getEmployerOid()

The above naming is a bit ugly.  It would be nice if there was a way to 
specify instead of getEmployerOid(), the method should be called getEmployer().

A template mechanism for code generation would be nice.

Also, there should be a way to specify to have either or, or both

1. Employer Employee.getEmployer()
2. String Employee.getEmployerOid()

Method 2 could be convenient when only the employerOid is needed and not the 
full Employer structure. This could improve performance.

Thanks...
Comment 1 Rochelle Raccah 2007-03-12 22:59:26 UTC
Note that I believe naming was like the proposal at one time (or maybe it was 
in transparent persistence) but there are issues with the proposal in the case 
of multiple relationships.
Comment 2 Dongmei Cao 2008-05-20 23:31:07 UTC

*** This issue has been marked as a duplicate of 81208 ***