hibernate find By Example, it will use all field

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=?
        )

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值