-->
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.  [ 4 posts ] 
Author Message
 Post subject: Middlegen/hbm2java and one to one relationships
PostPosted: Sun Nov 09, 2003 8:56 am 
Newbie

Joined: Tue Oct 21, 2003 4:49 am
Posts: 2
Hi,

I have successfully used Middlegen to create a number of *.hbm.xml files against tables my development schema.

I am running hbm2java from ant to generate the java classes and all seems to work well except I get a couple of errors when it tries to process 2 mappings files for tables that have a one to one relationship with each other. The generated files contain :

<!-- associations -->
<!-- bi-directional one-to-one association to ContactGroup -->
<one-to-one
name="contactGroup"
class="iat.hibernate.ContactGroup"
outer-join="auto"
constrained="true"
/>

and

<!-- associations -->
<!-- bi-directional one-to-one association to Group -->
<one-to-one
name="group"
class="iat.hibernate.Group"
outer-join="auto"
/>

I am not sure why but when the generator runs it gives me the following :

compile-hibernate:
[java] (hbm2java.ClassMapping 658 ) Could not find UserType: iat.hibernate.Group. Using the type 'iat.hibernate.Group' directly instead. (java.lang.ClassNotFoundException: iat.hibernate.Group)
[java] (hbm2java.ClassMapping 658 ) Could not find UserType:
iat.hibernate.ContactGroup. Using the type 'iat.hibernate.ContactGroup' directly instead. (java.lang.ClassNotFoundException: iat.hibernate.ContactGroup)

However - 2 classes do indeed get generated i.e Group.java and ContactGroup.java. Within them there appear to be references to the related class but I am very new to Hibernate and am not really sure what I am looking for i.e

Group.java
/** nullable persistent field */
private iat.hibernate.ContactGroup contactGroup;

ContactGroup.java

/** nullable persistent field */
private iat.hibernate.Group group;

Do I need to be concerned with the error I am seeing - at first glance it would appear to be generating code (all the other tables/relationships seem fine - just these 2) ???

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2003 1:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it's just a warning - not an error.

...but It should not happen ;)

Could you provide the 2 hbm.xml files + the command line you use to run hbm2java ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 7:20 am 
Newbie

Joined: Mon Nov 24, 2003 5:34 am
Posts: 2
>>it's just a warning - not an error....but It should not happen ;)

>>Could you provide the 2 hbm.xml files + the command line you use to run hbm2java ?[/i][/quote]

I am having EXACTLY the same problem so it's not a freak one off thing..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 4:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
We are going to need the mapping docs and the ant scripts etc to suggest anything, on the surface the xml looks OK but you never know.


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