Hi,
I have 2 entitiy classes, A and B.
@Entity
class A {
@Id
Long id;
...
@ManyToMany
private Collection bs;
...
}
@Entity
class B {
@Id
Long id;
...
@ManyToMany(mappedBy="bs")
private Collection as;
...
}
An app.server builds 3 database tables :
A
B
A_B(A_ID, B_ID)
I need get all data of B which are joined with one certain object A(or ID of object).
I have tried more version of NamedQuery but unsuccessfully. I donĀ“t what have to be a right query.
Could you help me with this.
Thank you
I have 2 entitiy classes, A and B.
@Entity
class A {
@Id
Long id;
...
@ManyToMany
private Collection bs;
...
}
@Entity
class B {
@Id
Long id;
...
@ManyToMany(mappedBy="bs")
private Collection as;
...
}
An app.server builds 3 database tables :
A
B
A_B(A_ID, B_ID)
I need get all data of B which are joined with one certain object A(or ID of object).
I have tried more version of NamedQuery but unsuccessfully. I donĀ“t what have to be a right query.
Could you help me with this.
Thank you