Question

I have a simple Boolean field in a pojo which I am storing in a gemfire region. The pojo also includes other fields with different data types (such as String, Long, Short, Date, etc). I have written a region query for each field and they return just fine all except the Boolean field. Example stub from my entity:

@Region("poc")
public class POCEntity {

    @Id
    @javax.persistence.Id
    private String id;
    private Boolean active;
    private String internalUsername;
    private Long dob;
    private Date createDate, updateDate;
        ...

And here is the repository stub:

//@Query("SELECT * FROM /poc p where p.active = false")
List<WellnessOptInEntity> findByActiveIsFalse();

I have tried every possible variation (with the manual query and with query generation) that I can find but querying the boolean field with PDX NOT configured always results in this exception:

java.lang.IllegalArgumentException: Unsupported operator TRUE! at org.springframework.data.gemfire.repository.query.Predicates$AtomicPredicate.getOperator(Predicates.java:174) at org.springframework.data.gemfire.repository.query.Predicates$AtomicPredicate.toClause(Predicates.java:137) at org.springframework.data.gemfire.repository.query.Predicates$AtomicPredicate.toString(Predicates.java:126) at org.springframework.data.gemfire.repository.query.Predicates.toString(Predicates.java:90) at org.springframework.data.gemfire.repository.query.QueryBuilder.create(QueryBuilder.java:44)

If I enable PDX, the query for the boolean field works fine. If PDX is not enabled (unit testing with a bootstrapped gemfire server for example), then the boolean query does not work.

Has anyone run into anything like this? I'm using gemfire 7.0.1 and spring-data-gemfire 1.3.3. I'm thinking this might be a bug in spring-data-gemfire but wanted to put this out there just to be sure.

Était-ce utile?

La solution

It looks like it is an actual defect. We have logged the details (along with a sample project simulating the defect) here:

https://jira.springsource.org/browse/SGF-247

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top