OK, it is a bit more complicated, that the first description, that has been designed to be as minimalist as possible:
There is part of acces-right system. There are objects, subjects and groups of subejcts and groups of objects. Each Subject is also an object and each Group of soemthing is also something. I would like to use this tree of infaritance:
Object
-Group of objects
-Subject
it seems also usefull to have an interface Group, that is implemented bt Group of objects and group of subjects. Some getters and setters in the system use the type Group.
The connection classes are to provide many-to many relationship. I can't to use built-in one, for some reasons.
It sems to bee everything usefull, i remember. Ok, the last notice: of course I don't use the classname Object, names are in Czech and use here translation for your better orientation :)
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Object" table="object" discriminator-value="1">
<id name="id" type="long" column="id">
<generator class="sequence">
<param name="sequence">idsequence</param>
</generator>
</id>
<discriminator column="discriminator" type="int" />
<property name="domain" />
<property name="idVRamciDomeny" column = "id_v_domene" />
<subclass name="Subject" discriminator-value="4" >
<subclass name="GroupSubjects" discriminator-value="6" />
</subclass>
<subclass name="GroupObjects" discriminator-value="2" >
</subclass>
</class>
<class name="ConnectionSubjGroup" table="skupiny_subjektu" >
<id name="id" type="long" column="id">
<generator class="sequence">
<param name="sequence">idsequence</param>
</generator>
</id>
<many-to-one name="subject" />
<many-to-one name="group" />
</class>
<class name="ConnectionObjGroup" table="skupiny_predmetu" >
<id name="id" type="long" column="id">
<generator class="sequence">
<param name="sequence">idsequence</param>
</generator>
</id>
<many-to-one name="object" />
<many-to-one name="group" />
</class>
<class name="Group" table="object" discriminator-value="0">
<id name="id" type="long" column="id">
<generator class="sequence">
<param name="sequence">idsequence</param>
</generator>
</id>
<discriminator column="discriminator" type="int" />
</class>
</hibernate-mapping>