I have following entity:
@Entity
class A {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
String id;
//some field
@ManyToMany
Set<B> other;
}
@Entity
class B {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
String id;
//some field
}
I would like to create hql
query which list ids
of B for A
entity contained in Set<B>
.
Somethig like (incorrect):
select a.other.id from A as a where a.id = :pid