openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashish paliwal <ashishpaliwal....@gmail.com>
Subject Two classes mapping to the same table
Date Wed, 24 Jun 2009 06:54:22 GMT
Hi,

I have a scenario. I have an existing schema where ClassA maps to TableA.
Now, I want to create a new class, ClassB which also maps to this very same
table. Functionaliyt that I require is that when data is searched for ClassA
instances, only records which were inserted by making Objects of ClassA
should be returned and no records that were created by making classB objects
should be returned.
For example- If I insert 3 records by making 3 Objects of classA and
persisting them and similarly I insert 2 records by making Object of classB
then persisting them then when I fire query "select a from classA a", only 3
records should be returned.
I wanted to know that is it possible in OpenJPA and is there any defination
in JPA using which I can map 2 classes to same table.

thanks and regards

-- 
Ashish Paliwal
Mobile : 9305128367
IIT Kanpur
India

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message