It defines a java-package namespace in effect for that <hibernate-mapping/>. Meaning, within that mapping declaration you do not need to fully qualify your domain class class-names *if* they are within that package.
Say I have a class with FQN "foo.Bar". In my mapping, I could either say:
Code:
<hibernate-mapping>
<class name="foo.Bar">
...
</class>
</hibernate-mapping>
- or -
Code:
<hibernate-mapping package="foo">
<class name="Bar">
...
</class>
</hibernate-mapping>
It also applies to assocation mappings. Say I also have "foo.Baz":
Code:
<hibernate-mapping package="foo">
<class name="Baz">
...
<many-to-one class="Bar" column="BAR_ID"/>
</class>
</hibernate-mapping>
- instead of -
Code:
<hibernate-mapping>
<class name="foo.Baz">
...
<many-to-one class="foo.Bar" column="BAR_ID"/>
</class>
</hibernate-mapping>
Its just a way to save typing