Reputation: 34725
I am new to Java Persistence API. I have just learnt it and now want to use it in my Java Desktop Application. But I have the following questions regarding it:
Q1. Which JPA implementation is smallest in size (as I want to have my application's size as small as possible)?
Q2. How to find the value of the <provider>
tag in the persistence.xml
file. I know that its value is vendor specific but I couldn't find the value for the JPA implementation downloaded from here.
Upvotes: 6
Views: 4284
Reputation: 570285
Q1. Which JPA implementation is smallest in size (as I want to have my application's size as small as possible)?
For JPA 1.0:
I would stay away from TopLink Essentials.
For JPA 2.0:
These measures have been done on my pet project (including dependencies except the JDBC driver). Personally, I wouldn't base my choice on the size only, even for a desktop app.
Q2. How to find the value of the tag in the persistence.xml file.
org.datanucleus.jpa.PersistenceProviderImpl
org.eclipse.persistence.jpa.PersistenceProvider
org.hibernate.ejb.HibernatePersistence
org.apache.openjpa.persistence.PersistenceProviderImpl
oracle.toplink.essentials.PersistenceProvider
Upvotes: 5
Reputation: 15577
You mean size in memory ? or size of jar ? Size in memory depends on how many classes are being persisted, the metadata for them, how many EntityManagers open, what is in the L1/L2 caches. I know that DataNucleus uses less memory than Hibernate since users themselves have reported that, no idea against the other primary implementations.
Size of a jar is a pointless measure of anything, since the majority of things there may not be in use.
PS. DataNucleus is also a JPA1+2 implementation
Upvotes: 0
Reputation: 43651
Q1. VERY rough calculated:
Q2. Open the JAR, check the META-INF/services/javax.persistence.spi.PersistenceProvider
file.
Upvotes: 2