[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Eclipselink 1.1-M4 create OSGI EntityManagerFactory
|
Thanks Tom and Tim.
I have seen the examples before but it looks like something has change in the most recent builds since i receive a:
org.eclipse.persistence.config.PersistenceUnitProperties cannot be resolved.
org.eclipse.persistence.jpa.osgi.PersistenceProvider cannot be resolved.
Once i import those packages, it still says:
Access restriction: the method createEntityManagerFactory(String, Map) from the type PersistenceProvider is not accessible due to a restriction on required library ...
If i use the Persistence.createEntityManagerFactory(persistenceUnitName) i get an error saying wasn't able to load that persistence unit name. what can i do? Against which build was run the svn demo?
On Mon, Dec 8, 2008 at 6:23 AM, Tim Hollosy
<hollosyt@xxxxxxxxx> wrote:
Also check out my article here:
http://www.weheartcode.com/2008/08/27/eclipselink-in-j2se-rcp-applications/
It explains one way:
properties.put(PersistenceUnitProperties.TARGET_DATABASE, "Derby");
properties.put(PersistenceUnitProperties.JDBC_DRIVER,
"org.apache.derby.jdbc.ClientDriver");
properties.put(PersistenceUnitProperties.JDBC_URL,
"jdbc:derby://localhost:1527/sample;create=true");
properties.put(PersistenceUnitProperties.JDBC_USER, "app");
properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "app");
properties
.put(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_MIN, "1");
properties.put(PersistenceUnitProperties.JDBC_WRITE_CONNECTIONS_MIN,
"1");
properties.put(PersistenceUnitProperties.BATCH_WRITING, "JDBC");
properties.put(PersistenceUnitProperties.CLASSLOADER,
ComicsEntityManagerFactory.class.getClassLoader());
properties.put("eclipselink.logging.level", "FINE");
properties.put("eclipselink.logging.timestamp", "false");
properties.put("eclipselink.logging.session", "false");
properties.put("eclipselink.logging.thread", "false");
emf = new PersistenceProvider().createEntityManagerFactory("comics",
properties);
./tch