Try changing method a little bit, setting id
as parameter, not the whole Concept
.
This code assumes your SnomedDescription
class has something like private Concept concept
:
Query query = this.em.createQuery("SELECT descr FROM SnomedDescription descr WHERE descr.concept.conceptPk.id =:cid");
query.setParameter("cid", conc.getConceptPk().getId());
Also one more thing looks suspicious for me - Concept
and Description
are bound with one-to-many relation. Consider revising that, you may want to make Concept
has only one Description
.