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
|