openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1860) How do I get OpenJPA to use my custom classloader to load Entity classes?
Date Wed, 03 Nov 2010 18:44:27 GMT


Michael Dick commented on OPENJPA-1860:

I'm not sure where the custom classloader fits in. 

What I thought Kevin proposed was having a template xml mapping file. Before creating an EntityManagerFactory
your code would modify the xml mapping file with the correct table names (maybe copy it to
the correct location, something like that). Is your custom classloader doing that modification?

If you're operating over a set of known table names, maybe you could have a separate mapping
file for each set. It would be easier to just copy a file or change the mapping file name
in persistence.xml than to edit the file and replace tokens. 

> How do I get OpenJPA to use my custom classloader to load Entity classes?
> -------------------------------------------------------------------------
>                 Key: OPENJPA-1860
>                 URL:
>             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? (
> 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.

View raw message