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