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 - Entity Classes from Database (unique)
Summary: Entity Classes from Database (unique)
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Dongmei Cao
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-12 19:17 UTC by javydreamercsw
Modified: 2008-06-16 19:43 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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