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 |
How to know howmuch data is truncated?
Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?
What is jdbc driver for sql server?
Explain the two tier and three tier architecture of jdbc.
What is jdbc odbc bridge in java?
How to insert and delete a row programmatically? (new feature in JDBC 2.0)
Differentiate between a statement and a preparedstatement.
Explain about multiple implementations and drive manager?
can we create a own jdbc driver? how can we create?
Is oracle client required for jdbc connection?
what are the types of result sets in JDBC 3.0 ?
What is Type-1 Driver and when this driver is used?