hibernate - Subqueries with JPAExpressions -
with querydsl, trying members either in:
--saletransaction or --deductiontransaction or --collectiontransaction and not in
--memberpayment this have done far
jpaquery<coopmember> activemembersquerybuilder = queryfactory.query() .select(coopmember) .distinct() .from(coopmember) .where( coopmember.memberid.in( jpaexpressions .select(saletransaction.memberid.memberid) .from(saletransaction) .where(saletransaction.paymentperiod.eq(paymentperiod))) .or(coopmember.memberid.in( jpaexpressions .select(collectiontransaction.member.memberid) .from(collectiontransaction) .where(collectiontransaction.paymentperiod.paymentperiodid.eq(paymentperiod)))) .or(coopmember.memberid.in( jpaexpressions .select(deductiontransaction.memberid.memberid) .from(deductiontransaction) .where(deductiontransaction.paymentperiod.eq(paymentperiod)))) .and(coopmember.memberid.notin( jpaexpressions .select(memberpayment.memberid.memberid) .from(memberpayment) .where(memberpayment.paymentperiodid.eq(paymentperiod)) .where(memberpayment.paymenttransaction.paymenttype.id.eq(5)))) ); the problem have instead of getting members either in (saletransaction or deductiontransaction or collectiontransaction , memberpayment) , fetches data in entities, is, (saletransaction or deductiontransaction or collectiontransaction , memberpayment)
question
how can write querydsl query fetches member belongs of entities subquery , i.e
(saletransaction or deductiontransaction or collectiontransaction , memberpayment)
Comments
Post a Comment