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

List some new features available in jdbc 4.0?

0 Answers  


How to invoke Oracle Stored Procedure with Database Objects as IN/OUT?

0 Answers  


What are types of resultset?

0 Answers  


What is jndi lookup?

0 Answers  


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

3 Answers   Wipro,


Is jdbc part of j2ee?

0 Answers  


How do I find ojdbc jar version?

0 Answers  


Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?

0 Answers  


What is statement and preparedstatement in java?

0 Answers  


how you will execute the many tables data

1 Answers   Wipro,


Can you define a foreign key, with a key from the same table?

2 Answers   IBM,


What is the meaning of batch updates?

0 Answers  


Categories