Resolves JIRA improvement SGF-265, appropriately handling the 'new' Query result type (ResultsCollectionPdxDeserializerWrapper) introduced and returned by GemFire's Querying infrastructure in 7.0.2, breaking backwards compatibility with 7.0.1 for certain types of Queries.

This commit is contained in:
John Blum
2014-04-10 12:06:42 -07:00
parent bf21a98e85
commit 6ad31ba619
2 changed files with 8 additions and 2 deletions

View File

@@ -26,7 +26,9 @@ import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import com.gemstone.gemfire.cache.query.SelectResults;
import com.gemstone.gemfire.cache.query.internal.ResultsBag;
import com.gemstone.gemfire.cache.query.internal.ResultsCollectionPdxDeserializerWrapper;
/**
* {@link GemfireRepositoryQuery} using plain {@link String} based OQL queries.
@@ -118,6 +120,10 @@ public class StringBasedGemfireRepositoryQuery extends GemfireRepositoryQuery {
*/
private Collection<?> toCollection(Object source) {
if (source instanceof SelectResults) {
return ((SelectResults) source).asList();
}
if (source instanceof ResultsBag) {
ResultsBag bag = (ResultsBag) source;
return bag.asList();