Re: [appengine-java] Re: Any advantages on using the Key type instead of String or Long for PK
Is that mean that using a String type is not a bad thing to do? On 22 Dec 2009, at 14:05, datanucleus wrote: So I am wondering if there is any sort of implications when using the String type as the pk field. It's portable to other datastores ? ;-) -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com . To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en . -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Any advantages on using the Key type instead of String or Long for PK
Thanks a lot! On 22 Dec 2009, at 14:16, datanucleus wrote: Is that mean that using a String type is not a bad thing to do? From a pure persistence point of view, using a portable type (Long, String etc) makes total sense, since your classes aren't tied to GAE. Obviously Google may have some hidden functionality in their Key but thats for them to comment on -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com . To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en . -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Any advantages on using the Key type instead of String or Long for PK
Please note that you can still query a Key primary key using comparison, you just can't do it the exact way you've written your example: pm.newQuery(select from Person where key = :p).execute(person.getKey()); On Tue, Dec 22, 2009 at 6:30 AM, Michael Chan hsmc...@gmail.com wrote: Thanks a lot! On 22 Dec 2009, at 14:16, datanucleus wrote: Is that mean that using a String type is not a bad thing to do? From a pure persistence point of view, using a portable type (Long, String etc) makes total sense, since your classes aren't tied to GAE. Obviously Google may have some hidden functionality in their Key but thats for them to comment on -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com . To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en . -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.