How to write a query that can find me all item_number start with a certain value ?
For instance there are item_numbers like these :
123_abc
123_xyz
ierireire
321_add
999_pop
My current query looks like this :
“select from “+PayPal_Message.class.getName()+” where item_number == ‘”+Item_Number+”‘ order by item_number desc”
What’s a query look like that can return all item_numbers start with “123_” ?
Quoted from the google app engine docs:
Tip: Query filters do not have an explicit way to match just part of a string value, but you can fake a prefix match using inequality filters:
This matches every MyModel entity with a string property prop that begins with the characters
abc. The unicode stringu"\ufffd"represents the largest possible Unicode character. When the property values are sorted in an index, the values that fall in this range are all of the values that begin with the given prefix.