Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Databases
»
Object Relational Mapping
jpa problems
Kevin Pang
,
Ranch Hand
Jun 26, 2009 20:51:35
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
can i load the persistence.xml in my
java
code? and the persistence.xml is not in the "META-INF" folder.
how to achieve this?
thanks in adv.
Devaka Cooray
,
Sheriff
staff
Jun 27, 2009 03:06:46
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Kevin Pang wrote:
can i load the persistence.xml in my java code?
What did you mean by this?
Kevin Pang
,
Ranch Hand
Jun 27, 2009 03:31:05
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
i want to load the persistence.xml by my java source code, not by toplink jpa, so i can load the persistence.xml from outside the jar file directory META-INF.
Kevin Pang
,
Ranch Hand
Jun 27, 2009 03:45:12
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
I found in toplink src class:
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
public EntityManagerFactory createEntityManagerFactory(String emName, Map properties){ Map nonNullProperties = (properties == null) ? new HashMap() : properties; String name = emName; if (name == null){ name = ""; } JavaSECMPInitializer initializer = JavaSECMPInitializer.getJavaSECMPInitializer(); EntityManagerSetupImpl emSetupImpl = null; ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); try { Enumeration<URL> resources = currentLoader.getResources("META-INF/persistence.xml"); boolean initialized = false; while (resources.hasMoreElements()) { String puName = PersistenceUnitProcessor.buildPersistenceUnitName(PersistenceUnitProcessor.computePURootURL(resources.nextElement()), name);
any solution to modify the persistence configuration file path without change toplink source ?
Post by:
autobot
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
This thread has been viewed 2303 times.
Similar Threads
Bind the server IP to the EJB JNDI name
No Persistence provider for EntityManager named.....
EAR packaging - @Persistence Unit injection fails
Standalone JPA example
EJB can't find Optional Package and thus Persistence Unit in it
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:44:10
.