Execution default of goal com.mysema.maven:apt-maven-plugin:1.1.3:process failed: Plugin com.mysema.maven:apt-maven-plugin:1.1.3
or one of its dependencies could not be resolved: Failed to collect dependencies at com.mysema.maven:apt-maven-plugin:jar:1.1.3 ->
org.apache.commons:commons-io:jar:1.3.2 (com.mysema.maven:apt-maven-plugin:1.1.3:process:default:generate-sources)
프로젝트 우클릭 이후 RunAs -> Maven install(build) 해도 됨 , Maven -> update project
실행 Test 코드
@Test
public void testPredicate() {
String type="t";
String keyword="17";
BooleanBuilder builder = new BooleanBuilder();
QBoard board = QBoard.board;
if(type.equals("t")) {
builder.and(board.title.like("%"+keyword+"%"));
}
builder.and(board.bno.gt(0L));
Pageable pageable = PageRequest.of(0, 10);
Page<Board> result = repo.findAll(builder, pageable);
System.out.println(result.getSize());
List<Board> list = result.getContent();
list.forEach(b->System.out.println(b));
}
실행 Console 내용
Hibernate: select board0_.bno as bno1_0_, board0_.content as content2_0_, board0_.regdate as regdate3_0_, board0_.title as title4_0_, board0_.updatedate as updateda5_0_, board0_.writer as writer6_0_ from tbl_boards board0_ where (board0_.title like ? escape '!') and board0_.bno>? limit ?
Hibernate: select count(board0_.bno) as col_0_0_ from tbl_boards board0_ where (board0_.title like ? escape '!') and board0_.bno>?