-->
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.  [ 7 posts ] 
Author Message
 Post subject: Any tools for creating associations?
PostPosted: Wed Apr 12, 2006 12:02 pm 
Newbie

Joined: Wed Apr 12, 2006 11:53 am
Posts: 13
Dear all,

I was wondering, if there are any tools available to help create associations. I have generated the config and mapping files and associated Java classes using MyEclipse. However, as far as I can see, creating the associations between these classes is a largely manual task. Does anyone know, if there are any tools out there for this? The Hibernate tools don't seem to help here. Thanks a lot for any hints.

Cheers,

M.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate tools works fine (the ones in myeclipse is btw. based on an older version of hibernate tools).

The only requirement is just that you foreign keys in your database + your driver supports them.

Mysql does that in later versions.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 1:39 pm 
Newbie

Joined: Wed Apr 12, 2006 11:53 am
Posts: 13
Thanks a lot for the quick reply! Could you perhaps be a bit more specific in which way the tools will help me creating associations for existing classes, config and mapping files? I've read the tools documentation alright, but I can't see any code generation functions that will add the necessary code to both class files and both mappings files that are involved in an association. Is there some sort of wizard that lets me specify the association details and then it goes off to create the code?
(note: I am using the tools for eclipse).

Cheers,

M.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 1:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh ..it's pretty simple:

Create the foreign keys

run the reverse engineering

and out comes mapping and java files with proper associations mapping.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 1:52 pm 
Newbie

Joined: Wed Apr 12, 2006 11:53 am
Posts: 13
Alright, I see. I thought there might be a way to add associations to existing mappings and classes, rather than creating them anew again. Thanks a lot!

Cheers,

M.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 5:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes, edit the xml files and run code generation again and then we will generate the code for it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 14, 2006 7:51 am 
Newbie

Joined: Wed Apr 12, 2006 11:53 am
Posts: 13
I haven't really managed to use the reverse engineering tools properly. I get an error message about "hibernate-reverse-engineering-3.0.dtd" not being available, althought it is present in the right folder. Maybe it's my MyEclipseIDE installation interfering with the tools.

Anyway, I have created the associations manually now, which is a bit cumbersome, but I am very impressed with how Hibernate takes care of all the persistence work behind the scenes.

All the best,

Martin


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