google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Optionally validate query filter names and value types #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.

Original issue reported on code.google.com by scotthernandez on 19 Feb 2010 at 4:05

GoogleCodeExporter commented 9 years ago
Validate the filter criteria in queries. If the property is not valid (bad name 
not
matching fields of the kindClass, or doesn't match synthetic property names), 
or if
the value is of the wrong type then throw an exception. The exception will be 
Key
since you can't check for parents and the actual data. There may be more 
exceptions
like that.

This will keep people from making typos and using the wrong type for filters. 

This must be optional since people can add properties to the entity outside of
Objectify's normal persistence mechanism.

I'd suggest a (Query) doNotValidate() method be added to override this default
behaviour. 

The checks must be run (right) before the query is executed so that all errors 
can be
reported, after the query is constructed.

Original comment by scotthernandez on 19 Feb 2010 at 4:12

GoogleCodeExporter commented 9 years ago
Some of this can be done at compile time using the JSR 269 annotation processor 
that I wrote called objectify-query 
(http://code.google.com/p/objectify-query/).  

Perhaps we should add more features for more enforcements to objectify-query, 
rather than making runtime more complicated.

Original comment by bren...@doherty.net.nz on 12 Apr 2011 at 12:32

GoogleCodeExporter commented 9 years ago
I'm certainly +1 for that :-)

Original comment by lhori...@gmail.com on 12 Apr 2011 at 5:43

GoogleCodeExporter commented 9 years ago
Issue 54 has been merged into this issue.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:02

GoogleCodeExporter commented 9 years ago

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:38

GoogleCodeExporter commented 9 years ago
Issue 152 has been merged into this issue.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:51

GoogleCodeExporter commented 9 years ago
Another validation that should probably log a warning: querying on a property 
that is not indexed.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:51