I\'ve tried to read through the QueryDSL docs but I am still very confused. I\'m accustomed to writing a lot of SQL, but this is my first real crack at using QueryDSL w/ JPQL (
This should work
public Contact getContact(long providerId, long contactId) {
QProvider provider = QProvider.provider;
QContact contact = QContact.contact;
return new JPAQuery(em).from(provider)
.innerJoin(provider.contact, contact)
.where(provider.id.eq(providerId), contact.id.eq(contactId))
.singleResult(contact);
}