-->
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: One-to-many mapping with reverse engineering: just can't
PostPosted: Wed Nov 16, 2005 10:47 pm 
Newbie

Joined: Wed Nov 16, 2005 10:32 pm
Posts: 2
Howdy from a newbie,

I've been trying to generate the mapping files and classes using reverse engineering, but to no avail.

Here are the two tables I created for the sake of understanding the problem:

Code:
CREATE TABLE `def` (
  `def_id` int(5) NOT NULL auto_increment,
  `abc_id` int(5) NOT NULL default '0',
  PRIMARY KEY  (`def_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;


Code:
CREATE TABLE `abc` (
  `abc_id` int(5) NOT NULL auto_increment,
  PRIMARY KEY  (`abc_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;


I was expecting the reverse engineering tool to produce a one-to-many relationship using the FK abc_id in def, with a set element in the def.hbm.xml, but none of this happenened.

What am I doing wrong?

Thanks for your time and help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 11:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
There needs to be a constraint between the tables.


Top
 Profile  
 
 Post subject: In reply
PostPosted: Thu Nov 17, 2005 12:59 am 
Newbie

Joined: Wed Nov 16, 2005 10:32 pm
Posts: 2
Thank you David,

I promptly converted my myISAM tables to InnoDB and bingo! it worked.

Now I'll try to work out the rest, and the rest is: everything.

Thanks again


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.