google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

False "incorrect query type(s)" warning when using FieldEnd#sizeEq #433

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
morphia 0.99
mongo-java-driver 2.5.3
MongoDB 2.2.0

When using FieldEnd#sizeEq in a query with an Integer parameter, the following 
warning is incorrectly logged:

WARN com.google.code.morphia.mapping.Mapper - The type(s) for the query/update 
may be inconsistent; using an instance of type java.lang.Integer for the field 
com.foo.Bar.things which is declared as java.util.List

Mapper#isCompatibleForOperator doesn't currently handle FilterOperator.SIZE the 
way it should.

Original issue reported on code.google.com by matthew....@gmail.com on 2 Oct 2012 at 12:34

GoogleCodeExporter commented 9 years ago
This seems to apply to FilterOperator.ELEMENT_MATCH as well, though obviously 
in a different way (since an Integer parameter wouldn't necessarily make sense 
in that case).

Original comment by matthew....@gmail.com on 8 Oct 2012 at 5:27