3

I use Objectify for datastore operations in my GAE/Java application. I have used Objectify's @Embeded facility in a couple of places in my project. Objectify automatically flattens the nested objects within the entity marked by @Embeded notation using the . separator. Thus I have ended up with column names like entity.embededObject.Field

For example I have an entity 'Person' in my data store with two columns name and address.email.

I want to filter through Person in the datastore viewer by writing a simple GQL query. But the following query fails with a syntax error:

SELECT * FROM Person where address.email='mail@gmail.com'

whereas the following works as it should

SELECT * FROM Person where name='Joe'

What am I doing wrong?

Ashwin Prabhu
  • 9,285
  • 5
  • 49
  • 82
  • [UPDATE] The issue is addressed in the 1.5.3 pre-release of GAE-java http://code.google.com/p/googleappengine/issues/detail?id=2584 – Ashwin Prabhu Aug 10 '11 at 09:37

2 Answers2

1

Tested today, it is possible to run the following with backquotes

SELECT * FROM `your.kind`

I believe this holds true for any parameter, but please correct me if I am wrong.

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61
0

GQL currently doesn't support this - only 'word' characters are supported. You should definitely file this as a bug in the issue tracker.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • Then this is a serious drawback of using @Embeded notation in objectify, the documentation never mentioned. – Ashwin Prabhu Jul 15 '11 at 15:57
  • @Ashwin Actually, it's a bug in the GQL parser - it should definitely have support for a quoted syntax for accessing these parameters - which is why I suggested you file a bug. – Nick Johnson Jul 15 '11 at 22:59
  • Found a bug report on a similar issue in issue tracker. http://code.google.com/p/googleappengine/issues/detail?id=2584 Looks like some work has already begun on the fix. – Ashwin Prabhu Jul 16 '11 at 03:51