openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: find()'ing an abstract class
Date Fri, 16 Mar 2007 22:07:03 GMT
Hi Jeff,

If you've defined the id field or property in Entity class A, then  
this should work. If not, file a JIRA issue, upload a failing test  
case, and upload a fix, if you don't mind. ;-)

Craig

On Mar 16, 2007, at 3:01 PM, jeff wrote:

> class B extends A
> A is abstract
> B is concrete
>
> i have persisted an instance of B. now i try:
>
> A a = em.find(A.class, anId);
>
> openjpa fails with:
>
> ... Cannot create new application identity instance for abstract  
> class "class A"
>
> if i change the find to:
>
> A a = em.find(B.class, anId);
>
> openjpa works okay.
>
> this isn't a big deal, but i'd expect the find() on the abstract  
> class to work, because it seems like a mistake to expect the caller  
> to know the implementation of the class in order to fetch it, if  
> all they know about is the abstract class.
>
> for what it's worth, this test does work w/ toplink.
>
> thoughts?
>
>
>
>
> ---------------------------------
> Never miss an email again!
> Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message