4848 *
4949 * @author Christoph Strobl
5050 * @author Mark Paluch
51+ * @author Junghoon Ban
5152 * @since 1.7
5253 */
5354class RedisQueryEngine extends QueryEngine <RedisKeyValueAdapter , RedisOperationChain , Comparator <?>> {
@@ -89,7 +90,7 @@ private <T> List<T> doFind(RedisOperationChain criteria, long offset, int rows,
8990 if (criteria == null
9091 || (CollectionUtils .isEmpty (criteria .getOrSismember ()) && CollectionUtils .isEmpty (criteria .getSismember ()))
9192 && criteria .getNear () == null ) {
92- return getAdapter ().getAllOf (keyspace , type , offset , rows );
93+ return getRequiredAdapter ().getAllOf (keyspace , type , offset , rows );
9394 }
9495
9596 RedisCallback <Map <byte [], Map <byte [], byte []>>> callback = connection -> {
@@ -118,7 +119,8 @@ private <T> List<T> doFind(RedisOperationChain criteria, long offset, int rows,
118119 }
119120 }
120121
121- byte [] keyspaceBin = getAdapter ().getConverter ().getConversionService ().convert (keyspace + ":" , byte [].class );
122+ byte [] keyspaceBin = getRequiredAdapter ().getConverter ().getConversionService ().convert (keyspace + ":" ,
123+ byte [].class );
122124
123125 Map <byte [], Map <byte [], byte []>> rawData = new LinkedHashMap <>();
124126
@@ -139,7 +141,7 @@ private <T> List<T> doFind(RedisOperationChain criteria, long offset, int rows,
139141 return rawData ;
140142 };
141143
142- Map <byte [], Map <byte [], byte []>> raw = this .getAdapter ().execute (callback );
144+ Map <byte [], Map <byte [], byte []>> raw = this .getRequiredAdapter ().execute (callback );
143145
144146 List <T > result = new ArrayList <>(raw .size ());
145147 for (Map .Entry <byte [], Map <byte [], byte []>> entry : raw .entrySet ()) {
@@ -149,10 +151,10 @@ private <T> List<T> doFind(RedisOperationChain criteria, long offset, int rows,
149151 }
150152
151153 RedisData data = new RedisData (entry .getValue ());
152- data .setId (getAdapter ().getConverter ().getConversionService ().convert (entry .getKey (), String .class ));
154+ data .setId (getRequiredAdapter ().getConverter ().getConversionService ().convert (entry .getKey (), String .class ));
153155 data .setKeyspace (keyspace );
154156
155- T converted = this .getAdapter ().getConverter ().read (type , data );
157+ T converted = this .getRequiredAdapter ().getConverter ().read (type , data );
156158
157159 result .add (converted );
158160 }
@@ -169,10 +171,10 @@ public Collection<?> execute(RedisOperationChain criteria, Comparator<?> sort, l
169171 public long count (RedisOperationChain criteria , String keyspace ) {
170172
171173 if (criteria == null || criteria .isEmpty ()) {
172- return this .getAdapter ().count (keyspace );
174+ return this .getRequiredAdapter ().count (keyspace );
173175 }
174176
175- return this .getAdapter ().execute (connection -> {
177+ return this .getRequiredAdapter ().execute (connection -> {
176178
177179 long result = 0 ;
178180
@@ -194,9 +196,9 @@ private byte[][] keys(String prefix, Collection<PathAndValue> source) {
194196 int i = 0 ;
195197 for (PathAndValue pathAndValue : source ) {
196198
197- byte [] convertedValue = getAdapter ().getConverter ().getConversionService (). convert ( pathAndValue . getFirstValue (),
198- byte [].class );
199- byte [] fullPath = getAdapter ().getConverter ().getConversionService ()
199+ byte [] convertedValue = getRequiredAdapter ().getConverter ().getConversionService ()
200+ . convert ( pathAndValue . getFirstValue (), byte [].class );
201+ byte [] fullPath = getRequiredAdapter ().getConverter ().getConversionService ()
200202 .convert (prefix + pathAndValue .getPath () + ":" , byte [].class );
201203
202204 keys [i ] = ByteUtils .concat (fullPath , convertedValue );
@@ -208,7 +210,7 @@ private byte[][] keys(String prefix, Collection<PathAndValue> source) {
208210 private byte [] geoKey (String prefix , NearPath source ) {
209211
210212 String path = GeoIndexedPropertyValue .geoIndexName (source .getPath ());
211- return getAdapter ().getConverter ().getConversionService ().convert (prefix + path , byte [].class );
213+ return getRequiredAdapter ().getConverter ().getConversionService ().convert (prefix + path , byte [].class );
212214
213215 }
214216
0 commit comments