Regular |
|
Joined: Tue Nov 09, 2004 5:15 pm Posts: 100
|
I've a class A which has one to many relationship with class B. Each row in class B need not be unique and hence need not have a primary key, but should have A.id like below
class A {
private Long id;
Set<B> bs;
}
class B {
private Long aId;
private String data;
}
aId is the foreign key from A. Is it possible to have such relationship without having primary key in class B? class A --> Table A and class B---> Table B. Having primary key in class B is not going to help as each entry need not be unique. The only query that we'll run is to find all the entries in B where aId=XXXX.
Could please someone let me know if this is possible in hibernate?
Thanks for any input in advance!
|
|