You can't avoid the extra datastore query. Since we use a key-value store,
store additional details inside a UserDetail class. Instead of referencing
the User in a property (this creates a 1:N relationship between Usersa and
UserDetail), create a Key using KeyFactory.Builder (
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/KeyFactory.Builder.html)
with the User's ID. This guarantees a 1:1 relationship with the original
Google Account. You can then retrieve this UserDetail entity using a
retrieve by Key (pm.getObjectById()) which is very cheap to do.

On Tue, Apr 13, 2010 at 3:09 AM, klonq <[email protected]> wrote:

> I'm an old school Perl programmer from way back and thinking about
> getting back into the web_dev game. So I've been reading up on app
> engine and have decided to go with Java because I know even less about
> Python than I do Java.
>
> But my question is this, how would one go about implementing a user
> system on top of the app engine user system?
>
> Say for instance you wanted to use google's login/out system with
> google accounts and the session objects already established in
> UserServiceFactory but also wanted the user id to reference extra data
> unique to your system while minimizing db queries and processing.
> Unfortunately it is not possible to extend
> com.google.appengine.api.users (cannot subclass a final class).
>
> Has anyone come up with a clever way of doing this that they want to
> share?
>
> --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to