add woodpecker.yml

This commit is contained in:
_Bastler 2022-06-07 08:29:04 +02:00
parent 95376a2369
commit 83a52030f5
3 changed files with 12 additions and 6 deletions

6
.woodpecker.yml Normal file
View File

@ -0,0 +1,6 @@
# .woodpecker.yml
pipeline:
build:
image: maven:3-jdk-11
commands:
- mvn clean package -P db-mariadb

View File

@ -90,10 +90,10 @@ public class CommentManager {
*/ */
public Page<Comment> fetchFlagged(int page, int size, boolean asc) { public Page<Comment> fetchFlagged(int page, int size, boolean asc) {
Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created")); Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created"));
JPAQuery<Comment> query = jpaQueryFactory.selectFrom(qComment).leftJoin(qFlag).on(qComment.id.eq(qFlag.target)) JPAQuery<Comment> query = jpaQueryFactory.selectFrom(qComment).innerJoin(qFlag).on(qComment.id.eq(qFlag.target))
.where(qFlag.targetType.eq(Types.comment)).groupBy(qFlag.target); .where(qFlag.targetType.eq(Types.comment)).groupBy(qFlag.target).distinct();
JPAQuery<Long> countQuery = query.clone().select(qComment.id.countDistinct()); JPAQuery<Long> countQuery = query.clone().select(qComment.countDistinct());
Long count = countQuery.fetchOne(); Long count = countQuery.fetchOne();

View File

@ -409,10 +409,10 @@ public class EntryManager {
*/ */
public Page<Entry> fetchFlagged(int page, int size, boolean asc) { public Page<Entry> fetchFlagged(int page, int size, boolean asc) {
Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created")); Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created"));
JPAQuery<Entry> query = jpaQueryFactory.selectFrom(qEntry).leftJoin(qFlag).on(qEntry.id.eq(qFlag.target)) JPAQuery<Entry> query = jpaQueryFactory.selectFrom(qEntry).innerJoin(qFlag).on(qEntry.id.eq(qFlag.target))
.where(qFlag.targetType.eq(Types.entry)).groupBy(qFlag.target); .where(qFlag.targetType.eq(Types.entry)).groupBy(qFlag.target).distinct();
JPAQuery<Long> countQuery = query.clone().select(qEntry.id.countDistinct()); JPAQuery<Long> countQuery = query.clone().select(qEntry.countDistinct());
Long count = countQuery.fetchOne(); Long count = countQuery.fetchOne();