thanks for your answer! I would have one more question: how can I use Gemini JPA to be able to affect EMFB by passing my property map from code? Because In my case, when I start my bundles (Eclipse Run Configuration), I just get an EMF (not a factory builder) via Declarative Services~~Referenced Service from Equinox & Gemini JPA bundles.
Yes, that is precisely what the EntityManagerFactoryBuilder is for.
You can leave out the properties from the persistence.xml file, and
then when you call createEntityManagerFactory() on the builder you
can pass them in as properties.
-Mike
P.S. There is a forum that you can post questions to that we
encourage people to use. That way others who may have the same
questions can see the replies. See
http://www.eclipse.org/forums/index.php/f/153
On 9/29/2011 6:00 AM, András Liter wrote:
Dear Gemini developers,
I know its a developer ml, but I just didnt find any user mail
list for Gemini JPA, so I put my question here.
Is it possible to configure an EntityManager with the database URL
from code, via EntityManager's EntityManager(Map m) constructor?
So far I made it work from persistence.xml, but I tried to have a
Map in the constructor of EM (with only one URL property, other
props stayed in persistence.xml), and get the following error
during EM instantiantion:
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence
Services - 2.3.0.v20110604-r9504):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: URL was not specified
Do you have any ideas, how to make this "programmable"
configuration work?