It'll probably be easiest to recreate the entities. The thing about Keys is
that at the lowest layer, every entity's primary key is a "Key" object. A
risky possibility for daredevils: I *think* but I am not sure that if you
just changed the property to a Key, it would function for the reason I just
mentioned. The reason I'm not a fan of this is because there are about a
million ways it can blow up in your face ...

On Tue, Feb 2, 2010 at 2:48 PM, shaz <[email protected]> wrote:

> Hi,
>
> I am building a web app using GAE Java. I have a class that uses a
> Long ID as its primary key.
>
> I now want to create a new class that would be the parent class to
> this original class (a one to many relationship) however the children
> that already exist need to have a primary key of type "key", not the
> Long ID I have now.
>
> What is the best way to change the primary key to be type "key"
> instead of long for the existing persisted entities? Should I create a
> new class with primary key of type "key" and instantiate and persist
> new objects that copy the field values from the old ones? Or can I
> somehow just update the existing class?
>
> Thanks
>
> --
> 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