The meta attribute fails if I put at the end of the node <class> on *.hbm.xml files

Description

I am suprissed that that simple change doesn't work. If I put the meta information at the begining:

<class name="com.schinvest.lra.domain.Company" table="company">

<meta attribute="use-in-equals">true</meta>
<meta attribute="use-in-tostring" inherit="true">true</meta>

<id name="id" type="string">
<column name="company_id" length="6" />

<generator class="assigned" />
</id>

<property name="name" type="string">
<column name="name" length="40" />
</property>
.....
</class>

it works, but if I put it at the end

<class name="com.schinvest.lra.domain.Company" table="company">

<id name="id" type="string">
<column name="company_id" length="6" />

<generator class="assigned" />
</id>

<property name="name" type="string">
<column name="name" length="40" />
</property>
.....
<meta attribute="use-in-equals">true</meta>
<meta attribute="use-in-tostring" inherit="true">true</meta>
</class>

I get the following building error:

BUILD FAILED
P:\LRA\build.xml:387: Failed in building configuration when adding P:\LRA\src\orm\hibernate\com\schinvest\lra\domain\Company.hbm.xml

Total time: 3 seconds

why this happen????, I am respecting the DTD syntax. The idea behind to put such information at the end, is because it is easier to find the regular expresion: </class> using replace Ant task and just replace it by adding the meta information.

Environment

None

Activity

Show:

David Leal February 8, 2006 at 9:58 PM

Sorry, I thought that the order is not really important, just the structure. Thanks for the advice, I am going to review this.

Max Rydahl Andersen February 8, 2006 at 8:36 PM

maybe i'm blind, but that is definitly not following the DTD.

<!ELEMENT class (
meta*,
subselect?,
cache?,

which clearly says N meta's before anything else.

(the issue about tidy breaking here is another isse which should be seperate)

btw. use-in-equals = true on all properties/associations is dangerous

Fixed

Details

Assignee

Reporter

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

David Leal
Max Rydahl Andersen

Community Help Wanted

Yes, please

Components

Fix versions

Affects versions

Priority

Created February 8, 2006 at 8:30 PM
Updated February 8, 2006 at 9:58 PM
Resolved February 8, 2006 at 8:36 PM