Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>in NH you can't join in a join. the only way is to make it a reference, which does basicly the same thing</p> <pre><code>&lt;class name="MyClass" table="tblTable1"&gt; &lt;id name="Table1Key"&gt; &lt;generator class="identity"/&gt; &lt;/id&gt; &lt;property name="..." /&gt; &lt;many-to-one table="tblTable2" lazy="false"&gt; &lt;key column="Table1Key" /&gt; &lt;property name="..." /&gt; &lt;/many-to-one&gt; &lt;/class&gt; &lt;class name="MyClass2" table="tblTable2"&gt; &lt;join table="tblTable3"&gt; &lt;key column="Table2Key" /&gt; &lt;property name="..." /&gt; &lt;/join&gt; &lt;/class&gt; class MyClass { public virtual MyClass2 MyClass2 { get; set; } public virtual int MyClass2_MyProperty { get { return MyClass2.MyProperty; } set { MyClass2.MyProperty = value; } } } class MyClass2 { public virtual int MyProperty { get; set; } } </code></pre> <p>Edit Option 2: if you dont want <code>MyClass2</code> Maybe you can tweak this:</p> <pre><code>&lt;class name="MyClass" table="tblTable2"&gt; &lt;-- take table2 as the main table &lt;id name="Table1Key"&gt; &lt;generator class="sequence"&gt; &lt;-- can be problem here, use sequence (directly) instead? &lt;param name="sequencename"&gt;table1_id_squence&lt;/param&gt; // not sure about "sequencename" &lt;/generator&gt; &lt;/id&gt; &lt;property name="..." /&gt; &lt;join table="tblTable1"&gt; &lt;key column="Table1Key" /&gt; &lt;property name="..." /&gt; &lt;/join&gt; &lt;join table="tblTable3"&gt; &lt;key column="Table2Key" /&gt; &lt;property name="..." /&gt; &lt;/join&gt; &lt;/class&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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