Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-30 Thread Rüdiger Herrmann
Hi, removing IProject isn't really an option as it is the only entity class so far. The other yet to come entity classes will be designed with the same pattern (see previous post). However, after doing so it works. Yes, all three points are true for my environment. Cheers, Rüdiger Pinaki P

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-29 Thread Pinaki Poddar
Hi, To narrow the problem, I will suggest to suppress/remove IProject to see if that changes anything. Are the following statements true for your environment? 1. the persistent classes are not specified at tag of persistence.xml but specified as Map before construction of EMF. 2. The persisten

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-29 Thread Rüdiger Herrmann
Hi, again, your documentation is good, and your support as well. It's just me too dumb to read it. Sorry for bothering you, this I could've found out myself. But now for something completely different (hopefully not again a not-read-documentation-issue;) I get the stack trace below when co

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-29 Thread Pinaki Poddar
Hi, Configuring a ClassResolver[1] with MultiLoaderClassResolver[2] may be your answer. [1] http://openjpa.apache.org/docs/latest/manual/manual.html#openjpa.ClassResolver [2] http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/MultiLoaderClassResolver.html -- View this mess

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-29 Thread Rüdiger Herrmann
HURRAY, the example is working! But making the same changes to my PDE TestCases fails. I am pretty sure this is because of different class loaders. Is it possible to also specify a distinct class loader for each entity class? Background: I am running in an OSGi environment in which the code

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Pinaki Poddar
Hi, If the list of persistent classes are known *before* EntityManagerFactory is created, then a possible solution is as below: public class TestDynamic extends TestCase { public void testDynamic() { // create a semicolon-separated list of persistent class names

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Rüdiger Herrmann
If it is more convenient, I can also send the example projects, which consists of two classes, hsqldb.jar and the openJPA jars (which I can leave aside) Here goes the stack trace: Exception in thread "main" error> org.apache.openjpa.persistence.ArgumentException: The type "class org.example.o

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Pinaki Poddar
Hi, Can you post the entire stack trace? -- View this message in context: http://www.nabble.com/JPA%3A-adding-entities-to-EntityManagerFactory-programmatically-tp17500835p17523591.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Rüdiger Herrmann
: Rüdiger Herrmann <[EMAIL PROTECTED]> A : users@openjpa.apache.org Oggetto : JPA: adding entities to EntityManagerFactory programmatically Data : Tue, 27 May 2008 23:49:16 +0200 Hi, using OpenJPA in a JavaSE (Eclipse RCP) environment, I would like to register JPA-annotated classes that

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Rüdiger Herrmann
Hi, thanks for your reply. I found your documentation pretty good. I came across the RuntimeUnenhancedClasses property but overlooked the UN of Unenhanced and thus didn't give it a try. However the adjusted example (see attachment) still gives me: The type "...Person" has not been enhanced.

Re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Pinaki Poddar
Hi, The configuration property name is "openjpa.RuntimeUnenhancedClasses" and possible values are "supported", "unsupported" and "warn". With "supported", OpenJPA will be able to work with normal user-defined classes i.e. without any byte-code enhancement. > MetaDataRepository#addMetaData() or

re: JPA: adding entities to EntityManagerFactory programmatically

2008-05-28 Thread Marco Schwarz
I work on a RCP using openJPA and Derby. It works fine. Kann I see your RCP (and Plugin) Source? Bye Marco - Original Message - Da : Rüdiger Herrmann <[EMAIL PROTECTED]> A : users@openjpa.apache.org Oggetto : JPA: adding entities to EntityManagerFactory programmatically Data : T

JPA: adding entities to EntityManagerFactory programmatically

2008-05-27 Thread Rüdiger Herrmann
Hi, using OpenJPA in a JavaSE (Eclipse RCP) environment, I would like to register JPA-annotated classes that will participate in the persistence mechanism at runtime. Background: Presistence-aware classes are contributed via Eclipse Extension Points. All these classes have JPA annotations.