-->
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.  [ 6 posts ] 
Author Message
 Post subject: hibernatetool ant task
PostPosted: Wed Jan 31, 2007 3:29 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
I am using the ant task and would like to know how to make it generate the pojo with a composite key without a secondary id class
what setting do i change

PS SO far i like using the tools

_________________
LET IT BE :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 5:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you mean you want embedded composite id's inside your mappings ?

We do not recommend that at all when using the core (unless you really have to) and we don't support generation of that in the tools (and noone asked for it before...sooo you will have to come up with a good reason ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 12:44 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
http://www.hibernate.org/hib_docs/v3/re ... ompositeid

seems to set up some reasons for imbedded composite-keys.

If i am on drugs could you point me to using them as seperate classes?

and why does most of the documentation use imbedded ones.

and doesn't the use of seperate classes cause foreign key issues?

Yes we have the worse kind of legacy db ... non tech people designed it and the imbedded compsite keys so far have handled everthing.

I also have 40+ imbedded keys .... won't i have to change these?

is there a rpo/con list to both approaches?

PS I am not arguing just panicing that I change and then find out I can no longer support our data model

THanks for your reponse

_________________
LET IT BE :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
geoharp wrote:
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#components-compositeid

seems to set up some reasons for imbedded composite-keys.


huh ? it only shows external composite-keys.

Quote:
If i am on drugs could you point me to using them as seperate classes?


the docs you just pointed me to.

Quote:
and why does most of the documentation use imbedded ones.


huh ? no it does not. most of the docs uses single column/field id's. (not composite!)

Quote:
and doesn't the use of seperate classes cause foreign key issues?


huh!?

Quote:
Yes we have the worse kind of legacy db ... non tech people designed it and the imbedded compsite keys so far have handled everthing.


maybe you should tell me what you mean by "imbedded composite keys".

Quote:
I also have 40+ imbedded keys .... won't i have to change these?


depends what you actually mean.

Hibernate supports composite ids perfectly fine and these keys will of course be "embedded" into the same table as the data.....but in the object model it is much nicer to have the id encapsulated in its own class instead of being "flattend" out onto the entity.

Quote:
is there a rpo/con list to both approaches?


read about it here: http://www.hibernate.org/hib_docs/v3/re ... ompositeid

Quote:
PS I am not arguing just panicing that I change and then find out I can no longer support our data model


don't worry. hibernate supports more than what the tools generate...we just don't like to generate something we don't recommend people to do.

And embedded composite-ids into the domain model is not recommended.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 1:22 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
WHy is it not recommended?
And will usingh the external key class hurt setting up foreign key relatinships based only on part of the primary key?

and thanks for quick response it helps alot

_________________
LET IT BE :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 2:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
geoharp wrote:
WHy is it not recommended?


if you had read the part in the docs i pointed you would see it points out all the problems with it.

Quote:
And will usingh the external key class hurt setting up foreign key relatinships based only on part of the primary key?


I have no idea why you say this. external key class does not affect your table layout in any way.

_________________
Max
Don't forget to rate


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