Search code examples
javaeclipsehibernate-tools

Eclipse Hibernate XML Editor: Property tag validation


I'm using Eclipse Kepler.

In a hibernate mapping, exist two ways of setting a property tag:

Inline:

<property name="usrname" column="usr_name" type="string" not-null="true" length="64" />

And split:

<property name="usrname" type="string">
    <column name="usr_name" not-null="true" length="64"/>
</property>

The Hibernate 3.0 XML Editor does not give error with validation using the second form of property tag, but gives error with the first form.

I'm using this DTD for the mapping:

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

Why is this happening if the hibernate documentation for object mapping shows an example of property tag inline?

Thanks.


Solution

  • The errors that appeared in my mappings where related to attribute not known: column, type, not-null, length while using inline tags.

    Fortunately the errors were solved using the following DTD and cleaning my project compilation:

    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">