Skip to content

Commit aa6b1cb

Browse files
committed
Downgrade graphql-java to 22
1 parent 23ad41b commit aa6b1cb

File tree

1 file changed

+22
-20
lines changed
  • graphql-database-manager-core/src/main/java/com/phocassoftware/graphql/database/manager

1 file changed

+22
-20
lines changed

graphql-database-manager-core/src/main/java/com/phocassoftware/graphql/database/manager/Database.java

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.phocassoftware.graphql.database.manager.util.BackupItem;
1818
import com.phocassoftware.graphql.database.manager.util.HistoryBackupItem;
1919
import com.phocassoftware.graphql.database.manager.util.TableCoreUtil;
20+
2021
import java.util.ArrayList;
2122
import java.util.Arrays;
2223
import java.util.Collections;
@@ -32,8 +33,8 @@
3233
import java.util.function.Function;
3334
import java.util.stream.Collectors;
3435
import java.util.stream.Stream;
36+
3537
import org.dataloader.DataLoader;
36-
import org.dataloader.DataLoaderFactory;
3738
import org.dataloader.DataLoaderOptions;
3839

3940
@SuppressWarnings("unchecked")
@@ -60,29 +61,32 @@ public class Database {
6061
this.submitted = new AtomicInteger();
6162

6263
items = new TableDataLoader<>(
63-
DataLoaderFactory
64-
.newDataLoader(
65-
driver::get,
66-
DataLoaderOptions.newOptions().setMaxBatchSize(driver.maxBatchSize()).build()
67-
),
64+
new DataLoader<DatabaseKey<Table>, Table>(
65+
keys -> {
66+
return driver.get(keys);
67+
},
68+
DataLoaderOptions.newOptions().setMaxBatchSize(driver.maxBatchSize())
69+
),
6870
this::handleFuture
6971
); // will auto call global
7072

7173
queries = new TableDataLoader<>(
72-
DataLoaderFactory
73-
.newDataLoader(
74-
keys -> merge(keys.stream().map(driver::query)),
75-
DataLoaderOptions.newOptions().setBatchingEnabled(false).build()
76-
),
74+
new DataLoader<DatabaseQueryKey<Table>, List<Table>>(
75+
keys -> {
76+
return merge(keys.stream().map(driver::query));
77+
},
78+
DataLoaderOptions.newOptions().setBatchingEnabled(false)
79+
),
7780
this::handleFuture
7881
); // will auto call global
7982

8083
queryHistories = new TableDataLoader<>(
81-
DataLoaderFactory
82-
.newDataLoader(
83-
keys -> merge(keys.stream().map(driver::queryHistory)),
84-
DataLoaderOptions.newOptions().setBatchingEnabled(false).build()
85-
),
84+
new DataLoader<DatabaseQueryHistoryKey<Table>, List<Table>>(
85+
keys -> {
86+
return merge(keys.stream().map(driver::queryHistory));
87+
},
88+
DataLoaderOptions.newOptions().setBatchingEnabled(false)
89+
),
8690
this::handleFuture
8791
); // will auto call global
8892

@@ -254,8 +258,7 @@ public CompletableFuture<Boolean> destroyOrganisation(final String organisationI
254258
*
255259
* @param <T> database entity type to update
256260
* @param entity revision must match database or request will fail
257-
* @return updated entity with the revision incremented by one
258-
* CompletableFuture will fail with a RevisionMismatchException
261+
* @return updated entity with the revision incremented by one CompletableFuture will fail with a RevisionMismatchException
259262
*/
260263
public <T extends Table> CompletableFuture<T> put(T entity) {
261264
return put(entity, true);
@@ -265,8 +268,7 @@ public <T extends Table> CompletableFuture<T> put(T entity) {
265268
* @param <T> database entity type to update
266269
* @param entity revision must match database or request will fail
267270
* @param check Will only pass if the entity revision matches what is currently in the database
268-
* @return updated entity with the revision incremented by one
269-
* CompletableFuture will fail with a RevisionMismatchException
271+
* @return updated entity with the revision incremented by one CompletableFuture will fail with a RevisionMismatchException
270272
*/
271273
public <T extends Table> CompletableFuture<T> put(T entity, boolean check) {
272274
return putAllow

0 commit comments

Comments
 (0)