|
1 | 1 | package com.aerospike.mapper.tools;
|
2 | 2 |
|
3 |
| -import java.io.File; |
4 |
| -import java.io.IOException; |
5 |
| -import java.io.InputStream; |
6 |
| -import java.lang.reflect.Array; |
7 |
| -import java.util.ArrayList; |
8 |
| -import java.util.List; |
9 |
| -import java.util.concurrent.atomic.AtomicBoolean; |
10 |
| -import java.util.function.Function; |
11 |
| - |
12 |
| -import javax.validation.constraints.NotNull; |
13 |
| - |
14 |
| -import org.apache.commons.lang3.StringUtils; |
15 |
| - |
16 | 3 | import com.aerospike.client.AerospikeException;
|
17 | 4 | import com.aerospike.client.AerospikeException.ScanTerminated;
|
18 | 5 | import com.aerospike.client.Bin;
|
|
39 | 26 | import com.fasterxml.jackson.core.JsonProcessingException;
|
40 | 27 | import com.fasterxml.jackson.databind.ObjectMapper;
|
41 | 28 | import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
| 29 | +import org.apache.commons.lang3.StringUtils; |
| 30 | + |
| 31 | +import javax.validation.constraints.NotNull; |
| 32 | +import java.io.File; |
| 33 | +import java.io.IOException; |
| 34 | +import java.io.InputStream; |
| 35 | +import java.lang.reflect.Array; |
| 36 | +import java.util.ArrayList; |
| 37 | +import java.util.List; |
| 38 | +import java.util.concurrent.atomic.AtomicBoolean; |
| 39 | +import java.util.function.Function; |
42 | 40 |
|
43 | 41 | public class AeroMapper implements IAeroMapper {
|
44 | 42 |
|
@@ -321,11 +319,13 @@ public <T> T[] read(BatchPolicy batchPolicy, @NotNull Class<T> clazz, @NotNull O
|
321 | 319 | return readBatch(batchPolicy, clazz, keys, entry);
|
322 | 320 | }
|
323 | 321 |
|
324 |
| - @SuppressWarnings("unchecked") |
| 322 | + @SuppressWarnings({"deprecation", "unchecked"}) |
325 | 323 | private <T> T read(Policy readPolicy, @NotNull Class<T> clazz, @NotNull Key key, @NotNull ClassCacheEntry<T> entry, boolean resolveDependencies) {
|
326 |
| - Object objectForKey = LoadedObjectResolver.get(key); |
327 |
| - if (objectForKey != null) { |
328 |
| - return (T) objectForKey; |
| 324 | + if (readPolicy == null || (readPolicy.filterExp == null && readPolicy.predExp == null)) { |
| 325 | + Object objectForKey = LoadedObjectResolver.get(key); |
| 326 | + if (objectForKey != null) { |
| 327 | + return (T) objectForKey; |
| 328 | + } |
329 | 329 | }
|
330 | 330 | if (readPolicy == null) {
|
331 | 331 | readPolicy = entry.getReadPolicy();
|
|
0 commit comments