• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Adding persistence.xml dynamically

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

I'm currently working on software to represent a JPA Annotated Model. The program needs a JAR-file, with the annotated classes, as input. The JAR-file also contains the persistence.xml for that model.

It's no problem to iterate the JAR and put all the classes to the classpath dynamically.

But the problem is the persistence unit: My question is ambiguous:

1) is there a way to use the persistence.xml file from the JAR with the persistence unit description in my program?
2) can you add dynamically annotated entities to a Persistence Unit without using Hibernate? So that I can use one persistence unit and just add all classfiles from the jar to it.


PS. I'm using Toplink essentials as JPA implementation, but I've tried it with EclipseLink and OpenJPA as well.

Jonas Wille
 
Jonas Wille
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a solution by myself
 
The only cure for that is hours of television radiation. And this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic