I have two tables
tab1 { col1 (PK), col2, col3 }
tab2 { col1, col2(PK), col3 }
I am using Hibernate annotation for joining using "OneToOne"
I have the below Hibernate class for tab1
class tab1 {
@OneToOne
@JoinColumn(name = "col2", referencedColumnName = "col1")
private tab2 t2;
}
i was expecting to run the below sql
select * from tab1 t1, tab2 t2 where t1.col1 = t2.col2
But it is not working as i expected.Please help