The quickest solution might be to wrap your entity fetch in a try/
catch (Throwable t)
block.  Throwable will catch a runtime exception.  Upon the expected
exception, use
the alternate variable type to try another fetch.


On Jul 6, 1:34 pm, Jeff Schnitzer <j...@infohazard.org> wrote:
> On Wed, Jul 6, 2011 at 12:56 PM, jMotta <jayrmo...@gmail.com> wrote:
> > *
> > *
> > *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.
>
> The conversion process will merrily convert just about anything to a String.
>  So going from Long -> String is easy.  The other way 'round, you would need
> to use the @AlsoLoad mechanism.
>
> 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 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.

Reply via email to