-->
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.  [ 1 post ] 
Author Message
 Post subject: declaring one-to-one relationship in mysql
PostPosted: Fri Mar 25, 2005 6:24 pm 
Newbie

Joined: Wed Jan 19, 2005 2:39 pm
Posts: 16
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.8

Hibernate extensions version:2.1.3

MySQL Version: 4.0.20

mysql-connector-java version:3.1.7

middlegen version:2.1

I can't get middlegen to create a one-to-one relationship from a mysql database.

My most recent attempt uses these create statements:

Code:
CREATE TABLE boat (
  id VARCHAR(128) NOT NULL,
  name VARCHAR(128) NULL,
  PRIMARY KEY(id)
)
TYPE=InnoDB;

CREATE TABLE anchor (
  boat_id VARCHAR(128) NOT NULL,
  name VARCHAR(128) NULL,
  UNIQUE INDEX anchor_FKIndex1(boat_id),
  FOREIGN KEY(boat_id)
    REFERENCES boat(id)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
)
TYPE=InnoDB;


Middlegen shows the relation as one-to-many (a boat can have many anchors). What do these create statements need to look like?

Any help is greatly appreciated.

TIA
Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.