comparison artifacts/src/main/java/org/dive4elements/river/utils/BatchLoader.java @ 9726:0a5239a1e46e 3.2.x

Upgrade to Log4j 2
author Tom Gottfried <tom@intevation.de>
date Wed, 02 Mar 2022 10:26:50 +0100
parents b0c88ac9f63b
children
comparison
equal deleted inserted replaced
9725:da398790fa32 9726:0a5239a1e46e
12 import java.util.HashMap; 12 import java.util.HashMap;
13 import java.util.Iterator; 13 import java.util.Iterator;
14 import java.util.List; 14 import java.util.List;
15 import java.util.Map; 15 import java.util.Map;
16 16
17 import org.apache.log4j.Logger; 17 import org.apache.logging.log4j.Logger;
18 import org.apache.logging.log4j.LogManager;
18 import org.hibernate.SQLQuery; 19 import org.hibernate.SQLQuery;
19 import org.hibernate.Session; 20 import org.hibernate.Session;
20 21
21 /** To reduce the number of SQL queries send to the backend 22 /** To reduce the number of SQL queries send to the backend
22 * (mainly by the fixings overviews) we execute them in batches of ids 23 * (mainly by the fixings overviews) we execute them in batches of ids
25 * Is there a way to use Hibernate with java.sql.Array 26 * Is there a way to use Hibernate with java.sql.Array
26 * in cross database compatible manner? 27 * in cross database compatible manner?
27 */ 28 */
28 public abstract class BatchLoader<T> { 29 public abstract class BatchLoader<T> {
29 30
30 private static Logger log = Logger.getLogger(BatchLoader.class); 31 private static Logger log = LogManager.getLogger(BatchLoader.class);
31 32
32 public static final int BATCH_SIZE = 100; 33 public static final int BATCH_SIZE = 100;
33 34
34 private Map<Integer, T> loaded; 35 private Map<Integer, T> loaded;
35 private List<Integer> rest; 36 private List<Integer> rest;

http://dive4elements.wald.intevation.org