Skip to content

Commit 5f2caec

Browse files
author
Gerald Unterrainer
committed
SingleQueryBuilder simplification
1 parent 4c36ab7 commit 5f2caec

File tree

4 files changed

+10
-38
lines changed

4 files changed

+10
-38
lines changed

src/main/java/info/unterrainer/commons/httpserver/daos/AsyncJpqlDao.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public AsyncListQueryBuilder<P, P> select(final String selectClause) {
7676
* @param id the ID to fetch.
7777
* @return the element with the given ID or null, if there was no such thing
7878
*/
79-
public AsyncSingleQueryBuilder<P, P> select(final Long id) {
80-
return new AsyncSingleQueryBuilder<>(this, id);
79+
public SingleQueryBuilder<P, P> select(final Long id) {
80+
return new SingleQueryBuilder<>(this, id);
8181
}
8282
}

src/main/java/info/unterrainer/commons/httpserver/daos/AsyncSingleQueryBuilder.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/main/java/info/unterrainer/commons/httpserver/daos/BasicSingleQueryBuilder.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/java/info/unterrainer/commons/httpserver/daos/SingleQueryBuilder.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package info.unterrainer.commons.httpserver.daos;
22

33
import info.unterrainer.commons.rdbutils.entities.BasicJpa;
4+
import lombok.Getter;
5+
import lombok.RequiredArgsConstructor;
46

5-
public class SingleQueryBuilder<P extends BasicJpa, T> extends BasicSingleQueryBuilder<P, T, SingleQueryBuilder<P, T>> {
7+
@RequiredArgsConstructor
8+
public class SingleQueryBuilder<P extends BasicJpa, T>
9+
extends BasicQueryEntityManagerBuilder<P, T, SingleQueryBuilder<P, T>> {
610

7-
SingleQueryBuilder(final JpqlDao<P> dao, final Long id) {
8-
super(dao, id);
9-
}
11+
@Getter
12+
protected final BasicJpqlDao<P> dao;
13+
protected final Long id;
1014

1115
public P get() {
1216
if (entityManager == null)

0 commit comments

Comments
 (0)