-->
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: Bug: Ordered HBM loading and joined-subclass
PostPosted: Mon Oct 09, 2006 8:10 pm 
Newbie

Joined: Sat Apr 01, 2006 1:23 am
Posts: 14
Hibernate version:
Latest

Ok. Well I'm completely sure this is a bug (well, code flaw) but since the site asked me to post before submitting the JIRA, well, I thought I would post anyway to see if you want me to.

When using joined-subclass, AssemblyHbmOrderer::OrderedHbmFiles tries to be smart to load the files in the right order. The problem is if I have the following situation:

BaseClass.hbm.xml:
class BaseClass.

Class1.hbm.xml:
class Class1 extends BaseClass
class Class1Lookup

Class2.hbm.xml:
class Class2 extends BaseClass
class Class2Lookup

Because the ordering is by *filename*, and a given filename is loaded once... The code realises BaseClass needs to come before Class1 and Class2, which is correct. However, it then thinks that Class1Lookup and Class2Lookup can be loaded first (comment - "this class extends nothing, so put it at the front of the list because it is safe to process at any time").

This means that the class list contains:
Class1Lookup
Class2Lookup
BaseClass
Class1
Class2

which is completely correct. However, when this is converted to filenames, first of all Class1.hbm.xml is added (for Class1Lookup), then Class2.hbm.xml (for Class2Lookup), then BaseClass, leaving the following order:
Class1
Class2
BaseClass

which is broken.

So when the ordering distills class names back down to filenames for the load order, this piece is obviously flawed when there is more than one class per file.

Neil


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.