Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 38668 invoked from network); 3 Nov 2010 18:44:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Nov 2010 18:44:18 -0000 Received: (qmail 22970 invoked by uid 500); 3 Nov 2010 18:44:49 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 22810 invoked by uid 500); 3 Nov 2010 18:44:48 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 22802 invoked by uid 99); 3 Nov 2010 18:44:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Nov 2010 18:44:48 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=10.0 tests=ALL_TRUSTED,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Nov 2010 18:44:47 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oA3IiRf6021840 for ; Wed, 3 Nov 2010 18:44:27 GMT Message-ID: <1976904.224201288809867345.JavaMail.jira@thor> Date: Wed, 3 Nov 2010 14:44:27 -0400 (EDT) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1860) How do I get OpenJPA to use my custom classloader to load Entity classes? In-Reply-To: <25491929.111661288236680439.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12927948#action_12927948 ] 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: 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.