-->
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: composite id table annotations are not generated correctly
PostPosted: Thu Sep 08, 2005 2:40 pm 
Newbie

Joined: Wed May 12, 2004 5:09 pm
Posts: 17
Location: Los Angeles
I'm trying to reverse engineer (with annotations) a table with a composite id. I use:
<hibernatetool destdir="${gen.dst}">
<jdbcconfiguration packagename="com.umusic.ecrm.db.${db}"/>
<hbm2java ejb3="true"/>
</hibernatetool>

So it generates two classes: Whitelist and WhitelistId.

But the generated Whitelist class has this:

@Id(generate = GeneratorType.AUTO)
@Column(name = "cust_id")
@Column(name = "campaign_type_id")
public WhitelistId getId() {
return this.id;
}

which, of course, doesn't compile (duplicate Column). Questions:

1. Is there a way to make it work other than fixing the code manually?
2. If not, how do I fix it manually, i.e. can somebody provide a complete working example with annotated composite ids? I tried to follow the annothation manual, but it only has code excerpts and they don't work in my case. I get it to compile, but HQL queries fail.

Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 5:58 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The rev gen does not work in this case.
Check the Hibernate Annotation test suite (the id package for example) to find real working composite id examples

_________________
Emmanuel


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.