Hi
I am facing an issue regarding mapping a single pojo to two tables. The sample tables are as follows:
Code:
[b][u]Table1[/u][/b]
Col1Id
Col2
Col3
[b][u]Table2[/u][/b]
ColA
ColB
ColC
I would like to map these tables something like this:
Code:
@Entity(name="read")
@Entity(name="write")
@Table(name = "table1")
public class class1 {
@Column() --- specify entity type "read"
col1
@Column() --- specify entity type "read"
col2
@Column() --- specify entity type "read"
col3
@Column() --- specify entity type "write"
colA
@Column() --- specify entity type "write"
colB
@Column() --- specify entity type "write"
colC
}
This seems to be easy to be done using hbm file using entity-name. Please let me know how I could attain the same using annotations & How do i map the columns to a particular annotation. I am referring to Hibernate 3