|
From: <leg...@at...> - 2003-09-19 20:25:27
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-346 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-346 Summary: SchemaExport ignores user-specified unique index name Type: Bug Status: Unassigned Priority: Trivial Project: Hibernate2 Components: toolset Versions: 2.0.3 Assignee: Reporter: Robert Zhu Created: Thu, 18 Sep 2003 7:32 PM Updated: Thu, 18 Sep 2003 7:32 PM Environment: Any Description: > robertz wrote: I use SchemaExport to generate a mysql table called userandrole. The table has an internalId, which is the PK. It also has a unique key (index) comprising roleName and userName. The interesting thing is that this unique key generated for the table ignores the specified key name (key1). It uses the first column name of the composite key, ie, roleName. I am not sure if this is intentional or just a small bug in SchemaExport. Below is the Hibernate descriptor file. <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="com.abcd.persist.UserAndRole" table="userandrole" dynamic-update="false" dynamic-insert="false" > <id name="internalId" column="internalId" type="java.lang.Long" > <generator class="native"> </generator> </id> <property name="roleName" type="java.lang.String" update="true" insert="true"> <column name="roleName" unique-key="key1" length="200" not-null="true"/> </property> <property name="userName" type="java.lang.String" update="true" insert="true"> <column name="userName" unique-key="key1" length="200" not-null="true"/> </property> <property name="creationDate" type="java.util.Calendar" update="true" insert="true" column="creationDate" /> </class> </hibernate-mapping> ------------------------------- > Christian Bauer replied: The unique constraint name should be "key1". Please open a new JIRA issue. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |