-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: property "unique-key" doesn't use the property nam
PostPosted: Sat Jan 13, 2007 6:37 am 
Newbie

Joined: Fri Jan 12, 2007 4:50 am
Posts: 6
I am using the mySQLDialect, it seems that hibernate doesn't generate the name of the index when using 'unique-key'

unique (firstname, lastname) should be unique FIRSTLASTNAME (firstname, lastname) in my case

Hibernate version:
3.1.2

Mapping documents:
<hibernate-mapping>
<class name="events.Person" table="PERSONS">
<id name="id" column="PERSON_ID">
<generator class="native"/>
</id>
<property name="age"/>
<property name="firstname" unique-key="FIRSTLASTNAME"/>
<property name="lastname" unique-key="FIRSTLASTNAME"/>
</class>
</hibernate-mapping>

Name and version of the database you are using:
mySQL 5.0.17-NT

The generated SQL (show_sql=true):
[java] 19:21:50,444 DEBUG SchemaExport:296 - create table PERSONS (PERSON_ID bigint not null auto_increment, age integer, firstname varchar(255), lastname varchar(255), primary key (PERSON_ID), unique (firstname, lastname)) type=InnoDB


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 13, 2007 10:23 am 
Newbie

Joined: Mon Dec 25, 2006 3:14 pm
Posts: 18
checkout this: http://forum.hibernate.org/viewtopic.php?t=939655


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.