How to add a “myfields >= TRUNC(sysdate)” clause with ExpressionBuilder to a ReportQuery (Toplink)

StackOverflow https://stackoverflow.com/questions/8851573

  •  16-04-2021
  •  | 
  •  

質問

I've this code

            Expression expRefr = new ExpressionBuilder();
            expRefr = expRefr.and(new ExpressionBuilder().get("refrCd").equal(referenza));
            expRefr = expRefr.and(new ExpressionBuilder().get("enteCd").equal(pEnteCd));
            expRefr = expRefr.and(new ExpressionBuilder().get("dpCdTipo").equal("V"));

            final ReportQuery refrQuery = 
                new ReportQuery(BoEnteRefrPrmz.class, expRefr);

i need to add a dpDtFineVald>= TRUNC(sysdate) clause to the WHERE condition, what should i do? Something like

expRefr = 
   expRefr.and(new ExpressionBuilder().get("dpDtFineVald").greaterThanEqual(//What should i put here?);
役に立ちましたか?

解決

I have no idea about toplink or Expression. I just tried this with what I got from Google. Please check.

String format = "MM/dd/yyyy";

expRefr = expRefr.and(new ExpressionBuilder().get("dpDtFineVald").truncateDate(format).greaterThanEqual(new ExpressionBuilder().currentDate().truncateDate(format));
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top