openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <>
Subject [jira] Commented: (OPENJPA-147) <T> T OpenJPAEntityManager.createInstance(Class<T> cls) fails when T is interface
Date Thu, 15 Feb 2007 22:24:05 GMT


Craig Russell commented on OPENJPA-147:

Could you please attach the java definition of test.IPerson and the contents of META-INF/orm.xml
to this issue?

> <T> T OpenJPAEntityManager.createInstance(Class<T> cls) fails when T is interface
> ---------------------------------------------------------------------------------
>                 Key: OPENJPA-147
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Pinaki Poddar
>         Attachments: iface.trace.1.txt, iface.trace.2.txt, iface.trace.3.txt, iface.trace.4.txt,
> According to JavaDoc, OpenJPAEntityManager.createInstance() method 
>        public <T> T createInstance(Class<T> cls);
>      behaves as follows:
> "Create a new instance of type <code>cls</code>. If <code>cls</code>
>   an interface or an abstract class whose abstract methods follow the
>   JavaBeans convention, this method will create a concrete implementation
>   according to the metadata that defines the class"
> The method fails when T is an interface. The failure may be due to incorrect user configuration,
however, further
> information on this extension method is not available in OpenJPA documentation.
> Firstly, how to specify metadata for a interface that has bean-style methods? 
> Possibilities are:
> a) Annotating the Java interface definition with @Entity 
> b) Specifying in <class>org.acme.IPerson</class> in persistence.xml
> Either of the above fails. a) fails at parsing b) fails with "no metadata" 
> There may be a correct but undocumented way of specifying a managed interface. If that
is the case, then this JIRA report should be treated as a documentation bug. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message