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

What are the steps to connect to the database in java?

0 Answers  


Is possible to open a connection to a database with exclusive mode with JDBC?

0 Answers  


What are the jdbc drivers in java?

0 Answers  


Explain the role of driver in jdbc.

0 Answers  


What is executequery in java?

0 Answers  


Is it possible to connect to multiple databases simultaneously? Using single statement can one update or extract data from multiple databases?

0 Answers  


What does setautocommit do?

0 Answers  


Explain about multiple implementations and drive manager?

0 Answers  


How we store procedure in oralce for callable statements in jdbc

0 Answers  


What is the exception thrown by JDBC ?

7 Answers  


What isolation level is used by the DBMS when inserting, updating and selecting rows from a database?

0 Answers  


what are the Different types of exceptions in JDBC?

1 Answers  


Categories