retrieving data via key in java

33 views
Skip to first unread message

Giridhar Kannan

unread,
Dec 25, 2009, 8:38:37 PM12/25/09
to Google App Engine
hi all,
i would like to know how to use the query

<b>" select __key__ from Class-Name "</b> in java .
The same syntax is not working, it shows the following
<b> PrimaryExpression should be a VariableExpression with name
__key__ </b>
Please do help me.

Thank you.

Ikai L (Google)

unread,
Dec 30, 2009, 2:39:49 PM12/30/09
to google-a...@googlegroups.com
JDOQL isn't SQL, so I'm not surprised that this isn't working. It's not possible to retrieve only parts of an entity, so this syntax wouldn't have made a whole lot of sense. An alternate method of doing a Key only query is to use the low-level API:


When you form a query, set it to Keys only rather than retrieving complete entities. What this mean is that this only hits your indexes, returning the subset of keys that match. You can then use these Keys as you would normally use them.


--

You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.





--
Ikai Lan
Developer Programs Engineer, Google App Engine
Reply all
Reply to author
Forward
0 new messages