<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="ORM.NHibernate" namespace="ORM.NHibernate" xmlns="urn:nhibernate-mapping-2.2">
  <class name="Predmet" table="Predmet" lazy="true" >
    <id name="Id" column="Id">
      <generator class="identity" />
    </id>
    <many-to-one name="Ustav">
      <column name="UstavId" sql-type="int" not-null="true" />
    </many-to-one>
    <property name="Nazev">
      <column name="Nazev" sql-type="nvarchar" not-null="true" />
    </property>
    <property name="Zkratka">
      <column name="Zkratka" sql-type="char" not-null="true" />
    </property>
    <property name="Pocetkreditu">
      <column name="PocetKreditu" sql-type="tinyint" not-null="true" />
    </property>
    <property name="Popis">
      <column name="Popis" sql-type="nvarchar" not-null="true" />
    </property>
    <bag name="Uctitelpredmet">
      <key column="PredmetId" />
      <one-to-many class="Uctitelpredmet" />
    </bag>

    <bag name="BList" table="Uctitelpredmet" lazy="false" fetch="join" >
      <key>
        <column name="PredmetId" />
        <column name="UcitelId" />
      </key>
      <many-to-many class="Ucitel" >
        <column name="M2M2ParentBId1" />
        <column name="M2M2ParentBId2" />
      </many-to-many>
    </bag>
  </class>
</hibernate-mapping>