openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeff <>
Subject find()'ing an abstract class
Date Fri, 16 Mar 2007 22:01:50 GMT
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. 


Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message