-->
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: Mehrere unique-keys/index's auf einer table
PostPosted: Thu Oct 20, 2005 8:27 am 
Newbie

Joined: Thu Oct 20, 2005 7:30 am
Posts: 2
Hi,

ich würde gerne wissen, wie ich in einem hibernate-mapping-file mehrere unique-keys und/oder index's auf der gleichen Tabelle definieren kann, wobei einige der columns in mehreren der unique-keys bzw. index's vorkommen. Das wäre für mich wichtig, weil ich gerne das DB-Schema aus dem Hibernate-Mapping erzeugen möchte. Die nächste Frage ist, wie bekomme ich das mit der Reihenfolge der Attribute in den Indizes hin?

Beispiel: Ziel-DDL (hier für MySQL) sollte sein:

create TABLE T (
ID bigint not null,
A varchar(10),
B varchar(10),
C varchar(10),
primary key (ID),
unique(A,B),
unique(B,A)
);
create INDEX I on T (C,A);

Gruß
Kai-Uwe


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 10:04 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
<database-object>
...
</database-object>

in Hibernate 3.1


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.