I am using Hibernate 2.1.2. I have a seemingly simple mapping file (irrelevant bits omitted):
Code:
<hibernate-mapping package="my.root.package.hibernate">
<class name="Person" table="person">
<id name="key" type="integer" column="person_key">
<generator class="native"/>
</id>
<property name="givenName" type="character" column="person_given_name"/>
<property name="familyName" type="character" column="person_family_name"/>
</class>
</hibernate-mapping>
I run the Hbm2JavaTask from my Ant build.xml and it runs to completion with no warnings or errors. However, the generated Java code has no package declaration and is located in my root source code directory (which is appropriate for no being in a package).
My understanding from reading the documentation was that the package attribute should apply to all unqualified class names in the mapping file, including the unqualified class name given in the class element. Thus, I expected the generated Java class file to contain
Code:
package my.root.package.hibernate;
Did I misunderstand the documentation? If so, to what exactly does the named package string apply?