*Jamie*,

What I meant when I mentioned the low-level API, is because there he will
use the Entity type and retrieve the property value as an Object, also he
will have full access to the properties that one entity have or not.

But it's just for the matter of "normalizing" his database. Use it as the
primary mechanism to persist and retrieve objects isn't a good idea hehehe
...

*Jeff*,

You've said: "Objectify will let you change the field type to a String and
do the right thing out of the box.", how?

I know that's possible through @AlsoLoad annotation to override the default
behavior of binding properties based on the member name. But what I
understood about his need is that actually he have entities whose the
property names are equals but with different object types as values. So, the
only class shared in the String vs Long hierarchy will be Object.

Isn't this?

*Jayr Motta*
Software Developer
*
*
I'm  on 
BlackBeltFactory.com<http://www.blackbeltfactory.com/ui#!User/jmotta/ref=jmotta>
!



On Wed, Jul 6, 2011 at 4:03 PM, Jeff Schnitzer <[email protected]> wrote:

> On Wed, Jul 6, 2011 at 11:50 AM, jMotta <[email protected]> wrote:
>
>> Jamie,
>>
>> I don't know if get it right, but if it's part of the key it is not
>> possible to change.
>>
>
> It sounds like the id is being stored as a field/property of an entity -
> it's basically a foreign key.
>
>
>> If this property is not part of the key, then you'll have to deal with it.
>> Probably you're using some persistence framework such as JDO, JPA or
>> Objectify. These are probably trying to bind the properties found in the
>> datastore Entity object into somekind of DTO / POJO through reflection and
>> then getting this class cast exception.
>>
>
> Jamie, you didn't mention what API you are using to access the datastore.
>
> FWIW, Objectify will let you change the field type to a String and do the
> right thing out of the box.  It's a little more tricky if you have an index
> on that field, but reprocessing the data (thus recreating the index) is
> pretty simple - just load and save all the entities.  No need to go to the
> low-level api.
>
> Unfortunately JDO is more fragile - schema migration doesn't seem to have
> been planned into the API.
>
> Jeff
>
> --
> 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.
>

-- 
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