-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate composite-id + xdoclet
PostPosted: Wed Oct 13, 2004 1:07 am 
Newbie

Joined: Wed Oct 13, 2004 12:58 am
Posts: 1
Hello,
I am using Hibernate2.x for ORM and would like to use XDoclet for generating HBM files.

I have composite key in the tables.
So can somebody guide me about how to generate HBM file using XDoclet for composite IDs?

Also why does composite IDs have to be n different class?

Code samples would be useful..

Thanks in advance

Abhijit


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 2:16 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
search the forum, especially in the tools. this has been discussed many times

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 9:02 am 
Newbie

Joined: Mon Sep 27, 2004 9:40 am
Posts: 11
Location: Ostrava, Czech Republic
There's nothing special about mapping a composite ID using XDoclet from mapping a primitive ID, just use @hibernate.id tag as you always do:

/**
* @hibernate.id
*/
public YourCompositeId getId() {
return id;
}

XDoclet automatically detects from the return type whether the ID is composite or primitive. As primitive ID data types are considered int, long, float, double, boolean, byte, short, char, java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short, java.lang.String, java.math.BigDecimal and User Types. Any other data type (including your composite ID class) is considered as composite (ie. including java.util.Date). I use XDoclet CVS build 1.2.2.

HTH,
Pavel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.