What is <discriminator > in Hibernate? How exactly
inheritance of Object to Tables can be done? What is the
benefits of discriminator?
Answer / haneef
Hi,
<discriminator> is useful, when you want to write a single
mapping file for the multiple pojo s which are under
inheritance.
Ex : Person<---Employee<----PermanentEmployee
<hibernate-mapping>
<class name="app.Person" table="ONE_PERSONS"
discriminator-value="p">
<id name="perId" column="PID">
<generator class="increment" />
</id>
<discriminator column="P_TYPE" />
<property name="perName" column="PNAME" />
<subclass name="app.Employee" discriminator-value="e">
<property name="empId" column="ENO" />
</subclass>
<subclass name="app.PermanentEmployee"
discriminator-value="pe">
<property name="allow" column="ALLOW" />
</subclass>
</class>
</hibernate-mapping>
| Is This Answer Correct ? | 6 Yes | 2 No |
What do you mean by odbc?
What is the purpose of jdbc?
What is jdbc thin client in oracle?
How a driver can be loaded?
What is the jdbc rowset?
What is difference between odbc and jdbc?
What are the methods which can verify the cursor particular position?
What are the jdbc drivers in java?
How do I find ojdbc jar version?
Give an example of code used for setting up connection with a driver.
What are the sailent features of JDBC 2.0?
code to insert values/rows into oracle database from a java swing textfield when a button is pressed(using preparedstatements)