-->
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.  [ 10 posts ] 
Author Message
 Post subject: hbm2java comparator class and dependencies
PostPosted: Fri Aug 11, 2006 7:17 am 
Newbie

Joined: Fri Aug 11, 2006 7:08 am
Posts: 3
Hibernate version:3


Hi,
I am having trouble generating pojos with hbm2java. One hbm file has a Set element with a sort attribute of my.MyComparator. The set is a many-to-one relationship to another entity in a another hbm that I also wish hbm2java to generate.

hbm2java fails to generate the first entity above as it cannot find the class my.MyComparator, which cannot be compiled until the second entity has its java generated and compiled.

I tried using the <meta attribute="implements" tag to make the second entity implement Comparator and added a meta of "class-code" to implement the compare method. Then setting the class of this entity as the sort attribute on the related entities Set element. This does not work either. Still a problem with class not found.

Any ideas how I can get hbm2java to generate these two related entities when I also need to specify a Comparator?

Russell


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 13, 2006 3:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please put a request in jira with an accompanied sample file that fails.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:36 am 
Newbie

Joined: Mon Jun 26, 2006 4:52 am
Posts: 8
Hi,

I've got the same issue: I cannot generate POJO object if the comparator is not compiled yet ... and I cannot compile my comparator without the POJO object !

Did someone found a workround ?
I'll look into JIRA to see if this issue is being addressed.

I'll look

rgds


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
noone reported it yet AFAIK

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:49 am 
Newbie

Joined: Fri Aug 11, 2006 7:08 am
Posts: 3
Yeah, sorry. Not had time to report it yet. We launch on 6th December so I will have a bit more time to clean house then and can hopefully provide you with an example.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well, i would just need as minimum the stacktrace and how the comparator is specified ....the rest i can manage for this case.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. i can see i have a test for it in our unittests and here it does not fail.

what version are you guys using ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
....hm, it will fail (and hard to fix) because i can't get the collectiontype without instantiating the comparator.

you should be able to workaround it via <meta attribute="property-type">java.util.SortedSet<XYZ></meta>

..but let me know in a jira case still

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 12:08 pm 
Newbie

Joined: Mon Jun 26, 2006 4:52 am
Posts: 8
Hi,

I tried the workaround but it didn't change anything.
I'm using Hibernate 3.1. I also tried 3.2 without success.

I'll open a bug in JIRA, with the traces.

regards
julien


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 1:16 pm 
Newbie

Joined: Mon Jun 26, 2006 4:52 am
Posts: 8
I've entered the issue in JIRA. Reference key is HBX-825.

Thanks for your help !


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