Java 查询Dsl NumberPath类操作不';行不通
查询DSL NumberPath类操作不起作用。下面是代码Java 查询Dsl NumberPath类操作不';行不通,java,hibernate,querydsl,Java,Hibernate,Querydsl,查询DSL NumberPath类操作不起作用。下面是代码 BooleanBuilder whereClause = new BooleanBuilder(); if(columnType!=null && columnType.equalsIgnoreCase("Long")){ Number searchNumb= (Number)filterMap.get("searchText"); Long
BooleanBuilder whereClause = new BooleanBuilder();
if(columnType!=null && columnType.equalsIgnoreCase("Long")){
Number searchNumb= (Number)filterMap.get("searchText");
Long searchText=searchNumb.longValue();
NumberPath<Long> longColumn =
Expressions.numberPath(Long.class,query,searchType);
whereClause.and( longColumn.like("%"+searchText+"%") );
}
return logRepository.findAll(whereClause, pageable);
但是,当我在PGAdmin上使用bind值运行生成的sql时,它会给出一个结果,下面是我在PGAdmin上运行的sql
select count(commonlog0_.id) as col_0_0_ from common_log commonlog0_ where
cast(commonlog0_.process_id as varchar) like '%164%' escape '!'
select count(commonlog0_.id) as col_0_0_ from common_log commonlog0_ where
cast(commonlog0_.process_id as varchar) like '%164%' escape '!'