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 |
Explain the steps in writing a java program using jdbc?
What is jdbc servlet?
Which interface is responsible for transaction management in jdbc?
Can I use JDBC to execute non-standard features that my DBMS provides?
Does JDBC support stored procedures?
How to check jdbc driver version in websphere?
What are clob and blob data types in jdbc?
What is Apache DBCP API?
What is the benefit of having jdbcrowset implementation?
What is database deadlock ?
what are the types of result sets in JDBC 3.0 ?
How to move the cursor in scrollable resultset ?