Does anyone know if JPA supports polymorphism?  I've been working with JDO
because it appears to be better documented right now, but I'd switch for a
more Java-like model.
Tom

On Sun, Aug 23, 2009 at 7:22 AM, David Given <[email protected]> wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> jd wrote:
> [...]
> > I have a structure similar to this this:
> [...]
> > class Zoo
> > class Zebra implements Animal
> > class Donkey implements Animal
> [...]
> > javax.jdo.JDOUserException: Field "animal" is declared as a reference
> > type (interface/Object) but no implementation classes of "Animal" have
> > been found!
>
> JDO on App Engine doesn't support polymorphism, as I understand it,
> which means you have to store your Zebras and Donkeys separately. I take
> it that what you want is a mixed bag of Animals of differing objects?
>
> The only way I found of doing that was to manually serialise my objects
> and store them in Blobs. It's not as hard as it looks, as the low-level
> API is quite nicely designed, but you do need to explicitly pull fields
> you want indexed out of the object before serialisation and store them
> as indexable properties on the entity.
>
> - --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │
> │ "People who think they know everything really annoy those of us who
> │ know we don't." --- Bjarne Stroustrup
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iD8DBQFKkVCdf9E0noFvlzgRAmmBAJwIHs8T5Qy5t0FgQ/ik4oTdOca1rACg0Oy1
> IzwfB2MUttjgJZMdgAetr38=
> =U8uT
> -----END PGP SIGNATURE-----
>
> >
>

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