Note that there are some explanatory texts on larger screens.

plurals
  1. POhibernate many to relationship
    primarykey
    data
    text
    <p>i would like to maintain many to one relationship with two table on the database. I am using Oracle database and Hibernate. The tables are <strong>application</strong> and <strong>instrument</strong>. first one has two column : id and event. second table has three column : id, type and <strong>application</strong>. the hibernate mapping for application is like :</p> <p> </p> <pre><code> &lt;class name="com.tpdadmin.entity.Application" table="tpd_application_table"&gt; &lt;id name="id" column="id" type="java.lang.Long"&gt; &lt;generator class="sequence"&gt; &lt;param name="sequence"&gt;tpd_application_table_sequence&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="event" column="event" type="java.lang.String" /&gt; &lt;/class&gt; </code></pre> <p></p> <p>And for instrument is like :</p> <p> </p> <pre><code>&lt;class name="com.tpdadmin.entity.Instrument" table="tpd_instrument"&gt; &lt;id name="id" column="id" type="java.lang.Long"&gt; &lt;generator class="sequence"&gt; &lt;param name="sequence"&gt;tpd_instrument_sequence&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="type" column="type" type="java.lang.String" /&gt; &lt;many-to-one name="applicationTable" class="com.tpdadmin.entity.Application" column="application_table_id" insert="false" update="false" /&gt; &lt;/class&gt; </code></pre> <p></p> <p>i want to maintain relationship between these two entities. but with these hibernate mapping, i am not able to make their relationship. so guys please help me out.</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.
 

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