-->
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 one class to three or more tables?
PostPosted: Thu Dec 10, 2009 11:24 am 
Newbie

Joined: Thu Dec 10, 2009 10:32 am
Posts: 1
I am trying to figure out how to map one class to three or more tables.
To map one class to two tables is easy :

Code:
@Entity
@Table(name="firstTable")
@SecondaryTable(name=" secondTable")
Class SomeClass{

@Column(table="secondTable")
  public String getSecond() {return second;}
}

}


So far so good … but what if i have third property and wont to map it to thirdTable? I thought I could add another “@SecondaryTable(name=" thirdTable")

And then map the colomn

Code:
@Column(table="thirdTable")
  public String getThird() {return third;}
}


But I’m getting the Error saying that @SecondaryTable annotation can be used only once

Im using hib 3.3.2. Any ideas? TIA


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.