-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how to map this hierarchy with JPA
PostPosted: Fri Aug 07, 2009 7:46 am 
Newbie

Joined: Mon Jun 20, 2005 9:56 am
Posts: 1
Location: Istanbu-TR
Hello all,
I asked this question on JavaRanch forums but could not get help.I appreciate if you can give me some clue.

let's assume i have 3 classes,first one,lets say F1 is a a mapped super class
second one,namely F2, is an entity derives from first one
and third entity class named F3 is derived from second one F2

Code:
   @MappedClass public class F1{ 
       int i1; 
    ... 
     
    @Entity public class F2 extends F1{ 
       int i2; 
    ... 
     
    @Entity public class F3 extends F2{ 
      int i3; 
     ...


now the problem:

I want to have 2 tables
T2 mapped by F2 having i1 and i2 [note i1 is coming from F1]
T3 mapped by F3 having i1 and i3 [note i3 is coming from F1]

unfortunately since F3 is derived from F2,I can have i1 only in F2
but I want to have that mapped superclass' fields in both

thanks in advance,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.