-->
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: How to set sql types in association tables with XDoclet
PostPosted: Fri Jun 25, 2004 2:55 pm 
Regular
Regular

Joined: Wed Nov 05, 2003 10:57 pm
Posts: 96
I am using Hibernate 2.1.4 with XDoclet 1.2.1.

I have a unidirectional many-to-many association A * -------> * B

A and B have primary keys of type String (char(32)).

I want to generate the association table with the 2 foreign keys if type char(32).

This XDoclet tags:
* @hibernate.set
* role="bs"
* table="A_B_LNK"
* lazy="true"
* cascade="save-update"
* @hibernate.collection-key
* column="A_ID"
* @hibernate.collection-many-to-many
* column="B_ID"
* class="mypackage.B"

generates the following assication table:

create table A_B_LNK (
A_ID VARCHAR(255) not null, -- needed char(32)
B_ID VARCHAR(255) not null, -- needed char(32)
primary key (A_ID, A_ID)
);

I tried to use the "@hibernate.column" but id did not work with "hibernate.collection-key" or "hibernate.collection-many-to-many"

Any suggestion.

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 26, 2004 7:45 am 
Regular
Regular

Joined: Wed Nov 05, 2003 10:57 pm
Posts: 96
Is there a way to do this with XDoclet?


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.