openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugh (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1860) How do I get OpenJPA to use my custom classloader to load Entity classes?
Date Tue, 02 Nov 2010 23:14:23 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12927665#action_12927665
] 

Hugh commented on OPENJPA-1860:
-------------------------------

Oddly, this doesn't work for NamedQueries.

I've installed my custom classloader at startup as well as adding it to the openjpa.ClassResolver
setting.
A query works, but a namedquery fails with "PersistenceException: Invalid object name" for
the tablename.
Evidently NamedQueries don't read the orm.xml. Perhaps this is a bug?

How should I go about making this work for the namedqueries as well?

> How do I get OpenJPA to use my custom classloader to load Entity classes?
> -------------------------------------------------------------------------
>
>                 Key: OPENJPA-1860
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1860
>             Project: OpenJPA
>          Issue Type: Question
>          Components: jpa
>    Affects Versions: 2.0.1
>         Environment: OpenJPA 2.0.1 Java 1.6-22
>            Reporter: Hugh
>
> I have written a custom classloader and I can't work out how to get OpenJPA to use it
to load my entity classes.
> I've followed instructions I found to set Thread.currentThread().setContextClassLoader()
at startup before loading any EntityManager and it seems to load the OpenJPA classes and a
lot of others, but not the class I'm interested in.
> Is this the right approach?
> If so, where have I gone wrong? (http://openjpa.208410.n2.nabble.com/Dynamic-Table-value-td5645906.html)
> If not, how should this be done?
> Is there some sort of guide to accomplishing this that someone could point me to?
> Thanks.

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


Mime
View raw message