Note that there are some explanatory texts on larger screens.

plurals
  1. PONHibernate + Many-to-Many + bag + mapping table
    primarykey
    data
    text
    <p>I have following 3 classes. </p> <pre><code>BusinessStream Scheme Bus_Stream_Scheme_Map </code></pre> <p>When I try to execute <code>transaction.Commit()</code> method, after <code>session.SaveOrUpdate()</code> for <code>BusinessStream</code>, I get following error, </p> <p>cannot insert NULL into ("DBO"."BUS_STREAM_SCHEME_MAP"."BUS_STREAM_SCHEME_MAP_ID")</p> <p>HBM Files,</p> <p>BusienssStream</p> <pre><code>&lt;class name="BusinessStream" table="BUS_STREAM"&gt; &lt;id name="Id" column="BS_ID" type="Int32" &gt; &lt;generator class="sequence"&gt; &lt;param name="sequence"&gt;BUS_STREAM_SEQ&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="Name" column="Name" type="String"/&gt; &lt;property name="Description" column="Description" type="String"/&gt; &lt;bag name="Schemes" table="BUS_STREAM_SCHEME_MAP" lazy="false"&gt; &lt;key column="BUS_STREAM_ID"&gt;&lt;/key&gt; &lt;many-to-many class="Scheme" column="SCHEME_ID"&gt;&lt;/many-to-many&gt; &lt;/bag&gt; &lt;/class&gt; </code></pre> <p>Scheme</p> <pre><code>&lt;class name="Scheme" table="SCHEME_DEF"&gt; &lt;id name="Id"&gt; &lt;column name="SCHEME_ID"/&gt; &lt;generator class="native"&gt; &lt;param name="sequence"&gt;SCHEME_DEF_SEQ&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="Description" column="SCHEME_DESC" type="String"/&gt; &lt;/class&gt; </code></pre> <p>BusinessStream_Scheme_Map</p> <pre><code>&lt;class name="BusinessStreamSchemeMapping" table="BUS_STREAM_SCHEME_MAP"&gt; &lt;id name="Id"&gt; &lt;column name="BUS_STREAM_SCHEME_MAP_ID"/&gt; &lt;generator class="native"&gt; &lt;param name="sequence"&gt;BUS_STREAM_SCHEME_MAP_SEQ&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;/class&gt; </code></pre> <p>What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload