1.example
PtrsPosition examplePosition = new PtrsPosition();
PvTrs pvtrs = new PvTrs();
if (trade.getPvtrs() != null) {
pvtrs.setPortfoliocusip(trade.getPvtrs().getPortfoliocusip());//if not like this, it will use all the non null property to query
}
examplePosition.setPvtrs(pvtrs);
// examplePosition.setPvtrs(trade.getPvtrs());
examplePosition.setLoanfacility(trade.getLoanfacility());
List<PtrsPosition> ptrsPositions = new ArrayList<PtrsPosition>(ptrsPositionService
.getPositionsByExample(examplePosition));
2.sql
from
PTRSPOSITION this_,
LOANFACILITY loanfacili2_,
LOANDEAL loandeal5_,
PVTRS pvtrs1_
where
this_.LOANFACILITYID=loanfacili2_.LOANFACILITYID
and loanfacili2_.LOANDEALID=loandeal5_.LOANDEALID(+)
and this_.PTRSID=pvtrs1_.PVTRSID
and (
this_.POSITIONV=?
)
and (
pvtrs1_.PORTFOLIOCUSIP=?
)
and (
loanfacili2_.LDRFACILITYID=?
and loanfacili2_.LDRDEALID=?
and loanfacili2_.LOANXID=?
and loanfacili2_.FACILITYCUSIP=?
and loanfacili2_.FACILITYTYPE=?
and loanfacili2_.FACILITYNAME=?
and loanfacili2_.FACILITYDESC=?
and loanfacili2_.FACILITYSTATUS=?
and loanfacili2_.LSTATYPE=?
and loanfacili2_.GLOBALSIZE=?
and loanfacili2_.ORIGGLOBALSIZE=?
and loanfacili2_.GLOBALCCY=?
and loanfacili2_.FUNDEDFLAG=?
and loanfacili2_.FUNDEDAMOUNT=?
and loanfacili2_.UNFUNDEDAMOUNT=?
and loanfacili2_.DRAWDOWNLIMIT=?
and loanfacili2_.ISSUEDATE=?
and loanfacili2_.MATURITYDATE=?
and loanfacili2_.FIXEDRATEFLAG=?
and loanfacili2_.BASERATECATEGORY=?
and loanfacili2_.BASERATE=?
and loanfacili2_.SPREAD=?
and loanfacili2_.ALLINRATE=?
and loanfacili2_.COUPONFREQUENCY=?
and loanfacili2_.RATERESETFREQUENCY=?
and loanfacili2_.DAYCOUNT=?
and loanfacili2_.REPAYMENTSENIORITY=?
and loanfacili2_.SECUREDFLAG=?
and loanfacili2_.LIENSENIORITY=?
and loanfacili2_.PRORATAFLAG=?
and loanfacili2_.MINBORROWAMOUNT=?
and loanfacili2_.INCRBORROWAMOUNT=?
and loanfacili2_.PREPAYMENTOPTIONFLAG=?
and loanfacili2_.AMORTIZATIONFLAG=?
and loanfacili2_.EVERGREENREVOLVERFLAG=?
and loanfacili2_.TERMOUTREVOLVERCONVFLAG=?
and loanfacili2_.PAYMENTINKINDFLAG=?
and loanfacili2_.SNPRATING=?
and loanfacili2_.MOODYRATING=?
and loanfacili2_.COMMITEDOBLIGATIONFLAG=?
and loanfacili2_.ASSETID=?
and loanfacili2_.COVLITEFLAG=?
and loanfacili2_.RECORDSTATUS=?
and loanfacili2_.CREATEDBY=?
and loanfacili2_.CREATIONDATE=?
and loanfacili2_.MODIFIEDBY=?
and loanfacili2_.MODIFICATIONDATE=?
)