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 are pros and cons of using of Type-2 and Type-4 Drivers over Type-1 driver?
What is odbc. how is it related to sql cli?
What is JDBC Savepoint? How to use it?
Is there another way of dealing with the result set that could execute faster?
What do you mean by odbc?
Why is jdbc used?
What is the benefit of having jdbcrowset implementation?
What is database deadlock ?
After creating conntinpool in weblogic how to write the code in programe where i can use that pool object in the programe connecting to the database and how to debug programe withou eclipse
How do you create Connection?
Which Driver is preferable for using JDBC API in Applets?
What is jdbc class forname?