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 127234

Summary: Entity Classes from Database (unique)
Product: javaee Reporter: javydreamercsw <javydreamercsw>
Component: PersistenceAssignee: Dongmei Cao <dongmeic>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description javydreamercsw 2008-02-12 19:17:41 UTC
I know this isn't the place but didn't find anything related to Java Persistence.

The classes generated from the database don't take into account the unique key. Hibernate does support this.

See: 

http://docs.jboss.org/ejb3/app-server/HibernateAnnotations/reference/en/html_single/index.html

Section 2.2.1.1. Defining the table
Comment 1 Petr Dvorak 2008-04-23 09:06:12 UTC
I believe the correct category for this would be J2EE > Persistence. Reassigning to them...
Comment 2 Andrei Badea 2008-04-25 13:03:00 UTC

*** This issue has been marked as a duplicate of 76357 ***
Comment 3 Andrei Badea 2008-04-25 13:07:00 UTC
Whoops, not a duplicate.
Comment 4 Andrei Badea 2008-04-25 13:09:16 UTC
The unique constraints are used for schema generation, that's why the wizard doesn't generate them. Since you already
have the tables, it seems unlikely to want to generate them again from the entity classes.
Comment 5 Dongmei Cao 2008-06-06 22:31:56 UTC
http://hg.netbeans.org/main/rev/7379c3d2af36
Comment 6 Dongmei Cao 2008-06-16 19:43:04 UTC
In NetBean 6.5, there is an additional step (last step and optional) to allow the user to specify if Attributes for
Regenerating Tables should be generated. Unique constraints will be generated on @Table if the option is checked.

http://hg.netbeans.org/main?cmd=changeset;node=ec8e1f01702d