-->
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.  [ 2 posts ] 
Author Message
 Post subject: HibernateTools rev engineers one-to-many instead one-to-one
PostPosted: Sun Apr 16, 2006 1:09 pm 
Newbie

Joined: Sun Apr 16, 2006 1:02 pm
Posts: 12
Hi!

I let HibernateTools 3.1.0.beta4 reverse engineer a very simple db model:

table URLS:
urls_pkey
PRIMARY KEY (id)
urls_ukey
UNIQUE (url)

table HTML:
html_ukey
UNIQUE (urlid) // actually nonsense, I added this for HibernateTools but without success
html_fkey
FOREIGN KEY (urlid) REFERENCES urls(id) ON UPDATE CASCADE ON DELETE CASCADE
html_pkey
PRIMARY KEY (urlid)

In both cases urls and html it recognized a one-to-many relationship where it's actually one-to-one (1 url relates to 1 html doc and vice versa):

<set name="htmls" inverse="true">
<key>
<column name="urlid" length="32" not-null="true" unique="true" />
</key>
<one-to-many class="test.Html" />
</set>

Why is this?

BTW it also generated incorrect, non-parsable HBM like

<timestamp name="timestamp" type="timestamp" name="timestamp" />


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
regarding one-to-one, we just don't support that yet. patches are welcome in jira

regarding <timestamp> generation, please try out the latest nightly build. if that does not help report it in jira

_________________
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.  [ 2 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.