Joined: Tue Aug 01, 2006 5:19 pm Posts: 3
|
We have some special cases due to which we had to use this approach.
I have a 'Vendor' object which is a persistent class in hibernate mappings.
<hibernate-mapping package="com.verisign.vps.common.model">
<class
name="Vendor"
table="VENDORS"
>
I have 'UnifiedVendor' object extending 'Vendor' object. UnifiedVendor is also persistent in database.
hibernate-mapping package="com.paypal.vps.common.model">
<class
name="UnifiedVendor"
table="VENDORS"
>
Both pointing to same table. So if I run a named query like this
'select vendor from Vendor vendor where vendor.name = :vendorName'. It is running two queries against database
Hibernate: select vendor0_.VID from PAY.VENDORS vendor0_ where (vendor0_.NAME=? )
Hibernate: select unifiedven0_.VID as VID26_ from PAY.VENDORS unifiedven0_ where (unifiedven0_.NAME=? )
Result has two duplicate rows while I am expecting it to run just once.
Is there any work around for this, other than using SQL queries?
Thank you in advance.
taraka
|
|