Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
alpha tools 6 (jboss ide bundle)
Mapping documents:
GuestType.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="pethotel">
<class
name="GuestType"
table="GuestType"
>
<id
column="guestTypeId"
name="guestTypeId"
type="java.lang.Integer"
>
<generator class="increment">
</generator>
</id>
<property
name="name"
column="name"
type="string"
not-null="true"
>
</property>
<set
inverse="true"
lazy="true"
name="RoomTypeGuestSet"
>
<key column="guestTypeId" />
<one-to-many class="pethotel.RoomTypeGuest" />
</set>
<set
inverse="true"
lazy="true"
name="ServiceGuestSet"
>
<key column="guestTypeId" />
<one-to-many class="pethotel.ServiceGuest" />
</set>
<joined-subclass
name="Category"
table="Category"
>
<key column="categoryId"/>
<many-to-one
name="parent"
class="pethotel.Category"
not-null="true"
>
<column name="parent"/>
</many-to-one>
<set
inverse="true"
lazy="true"
name="childs"
>
<key column="parent" />
<one-to-many class="pethotel.Category" />
</set>
<set
inverse="true"
lazy="true"
name="SpeciesSet"
>
<key column="categoryId" />
<one-to-many class="pethotel.Species" />
</set>
</joined-subclass>
<joined-subclass
name="Species"
table="Species"
>
<key column="speciesId"/>
<many-to-one
name="categoryId"
class="pethotel.Category"
not-null="true"
>
<column name="categoryId"/>
</many-to-one>
<set
inverse="true"
lazy="true"
name="PetSet"
>
<key column="speciesId" />
<one-to-many class="pethotel.Pet" />
</set>
</joined-subclass>
</class>
</hibernate-mapping>
generated hibernate.cfg.xmlCode:
<mapping resource="pethotel/GuestType.hbm.xml" />
<mapping resource="pethotel/Category.hbm.xml" />
<mapping resource="pethotel/Species.hbm.xml" />
As you can see the artifact generator is generating the subclasses as separated files. Every time I have to remove them by hand. What I'm doing wrong ?
Thx
and.... aplha 6 version is much better!
[/code]