On Tue, Oct 25, 2011 at 1:31 PM, Laird Nelson <ljnel...@gmail.com> wrote:

> I've got a case where I'm building a query like this:
>
> TypedQuery<SomeInterface> q = em.createNamedQuery("someQuery",
> SomeInterface.class);
>
> Now, SomeInterface is not the actual entity class--that would be
> SomeInterfaceEntity (not mentioned above, as you'll note).  But it is an
> interface that the results of the query all implement.
>
> EclipseLink and Hibernate both accept this declaration just fine and run
> the associated query just fine.
>
> At runtime, this version of OpenJPA seems to be trying to treat
> SomeInterface.class as though it denoted an entity:
>
> <openjpa-2.0.0-beta3-r422266:926797 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: Result type "interface
> com.foobar.SomeInterface" does not have any public fields or setter methods
> for the projection or aggregate result element "SomeInterfaceEntity", nor
> does it have a generic put(Object,Object) method that can be used, nor does
> it have a public constructor that takes the types null.
>

I've filed https://issues.apache.org/jira/browse/OPENJPA-2065 to track
this.  Has anyone else run into this issue?

Best,
Laird

-- 
http://about.me/lairdnelson

Reply via email to