Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is <discriminator > in Hibernate? How exactly
inheritance of Object to Tables can be done? What is the
benefits of discriminator?



What is <discriminator > in Hibernate? How exactly inheritance of Object to Tables can be do..

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

Post New Answer

More JDBC Interview Questions

How to know howmuch data is truncated?

0 Answers   Mastek,


Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?

0 Answers  


What is jdbc driver for sql server?

0 Answers  


Explain the two tier and three tier architecture of jdbc.

0 Answers  


What is jdbc odbc bridge in java?

0 Answers  


How to insert and delete a row programmatically? (new feature in JDBC 2.0)

0 Answers  


Differentiate between a statement and a preparedstatement.

0 Answers  


Explain about multiple implementations and drive manager?

0 Answers  


can we create a own jdbc driver? how can we create?

1 Answers   HCL,


Is oracle client required for jdbc connection?

0 Answers  


what are the types of result sets in JDBC 3.0 ?

3 Answers   HCL,


What is Type-1 Driver and when this driver is used?

3 Answers  


Categories