我想执行以下操作
select column1,column2 from table where column1=column2
如何在querydsl中做到这一点?我下面有代码,但它绑定了key=value
答案 0 :(得分:0)
公共静态列表getAddressBooleanExpressions(字符串类型,类clazz){
列表booleanExpressions = new ArrayList();
PathBuilder entityPath = new PathBuilder(clazz,type);
BooleanExpression expression1 = entityPath.get(“ column1”)。eq(entityPath.get(“ column2”));;
BooleanExpression expression2 = entityPath.get(“ columnA”)。eq(entityPath.get(“ columnB”));
BooleanExpression expression3 =实体路径.get(“ columnX”)。eq(entityPath.get(“ columnZ”));
BooleanExpression expression4 = entityPath.get(“ physicalAddress”).eq(entityPath.get(“ mailingAddress”));
booleanExpressions.add(expression1);
booleanExpressions.add(expression2);
booleanExpressions.add(expression3);
booleanExpressions.add(expression4);
return booleanExpressions;
}