-->
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: XML Correct generation one-to-one case
PostPosted: Wed Feb 22, 2006 7:11 pm 
Newbie

Joined: Wed Feb 22, 2006 6:59 pm
Posts: 1
Hi,
sorry for my poor english but.. ok..
I use MySQL 5.0, eclipse 3.1 and Hibtools.. so...
I have 2 tables
Attivita and pagIntervento
they are in one-to-one relation with fileld "id" (primary key for all)

when I run de code generation I see in Attivita.hbm.xml files :

<set name="pagInterventois" inverse="true">
<key>
<column name="id" not-null="true" unique="true" />
</key>
<one-to-many class="it.codex.business.hbm.PagPignterzo" />
</set>

and not:

<one-to-one
name="pagInterventoi"
class="it.codex.business.hbm.PagInterventoi"
outer-join="auto"
cascade="all"
lazy="false" >
<meta attribute="field-description">
@hibernate.one-to-one
outer-join="auto"
cascade="all"
lazy="false"
</meta>
</one-to-one>

as I wrote time ago without Hibernate-tool

There is somethings wrong in my tables in MYSQL ?.. how I must define foreign keys in the table ?
PS. In pagInterventoi table I define a foreign key to Attivita using id field..

thank you for reply..



Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 7:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I am not sure what has been done recently but hibernate tools did not have one-to-one functionality (which Middlegen does as shown by your sample - my guess but I think I am right - I can smell my own code a mile away :-) ).

Max should be able to confirm.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 8:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
There is a JIRA for this request.
http://opensource2.atlassian.com/projects/hibernate/browse/HBX-524


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.