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 the steps to connect to the database in java?
Is possible to open a connection to a database with exclusive mode with JDBC?
What are the jdbc drivers in java?
Explain the role of driver in jdbc.
What is executequery in java?
Is it possible to connect to multiple databases simultaneously? Using single statement can one update or extract data from multiple databases?
What does setautocommit do?
Explain about multiple implementations and drive manager?
How we store procedure in oralce for callable statements in jdbc
What is the exception thrown by JDBC ?
What isolation level is used by the DBMS when inserting, updating and selecting rows from a database?
what are the Different types of exceptions in JDBC?