-->
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.  [ 1 post ] 
Author Message
 Post subject: Many-to-many with composite primary key
PostPosted: Fri Nov 30, 2007 12:26 pm 
Newbie

Joined: Tue Jan 09, 2007 12:01 pm
Posts: 3
Hello, I am trying to create a many-to-many relationship between Events and Products using the Oracle9 dialect. My version and annotations are listed below. The problem is that no composite primary key is created on the JoinTable. I got it to create a unique constraint instead using the uniqueConstraints attribute, but I would like Hibernate to create a true primary key. Is this possible? Thank you.

Hibernate version:
3.2.1.ga

Mapping documents:
@ManyToMany(cascade={}, fetch=FetchType.LAZY, mappedBy="")
@JoinTable(name = "EVENT_PRODUCTS",
uniqueConstraints = @UniqueConstraint(columnNames={"EVENT_ID", "PRODUCT_ID"}),
joinColumns = @JoinColumn(name = "EVENT_ID", referencedColumnName = "id", nullable = false, updatable = false),
inverseJoinColumns = @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "id", nullable = false, updatable = false))


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

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.