Java持久性API [英] Java Persistence API
问题描述
我是 Java持久性API 的新手.我刚刚学习了它,现在想在我的Java桌面应用程序中使用它.但是我对此有以下疑问:
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.哪个JPA实现的大小最小(因为我想让应用程序的大小尽可能小)?
Q1. Which JPA implementation is smallest in size (as I want to have my application's size as small as possible)?
Q2.如何在persistence.xml
文件中找到<provider>
标记的值.我知道它的价值是特定于供应商的,但是我找不到从
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.
推荐答案
Q1.哪个JPA实现的大小最小(因为我想让应用程序的大小尽可能小)?
Q1. Which JPA implementation is smallest in size (as I want to have my application's size as small as possible)?
对于JPA 1.0:
- 休眠实体管理器3.4.0.GA:〜4.9MB
- EclipseLink 1.1.3:〜4.7MB
- OpenJPA 1.2.2:〜2.7MB(我不确定此版本,目前尚未经过测试,因此我可能会缺少一些jars)
我会远离TopLink Essentials.
I would stay away from TopLink Essentials.
对于JPA 2.0:
- DataNucleus 2.0.3:〜3.7MB
- EclipseLink 1.2和2.0+:〜4.8MB
- Hibernate Entity Manager 3.5.0-Final:〜5.8MB
- OpenJPA 2.0.0-beta3:未测量(仍为beta)
这些措施已经在我的pet项目中完成(包括JDBC驱动程序以外的依赖项).就个人而言,即使是台式机应用程序,我也不会只选择大小.
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.如何在persistence.xml文件中找到标记的值.
Q2. How to find the value of the tag in the persistence.xml file.
- DataNucleus:
org.datanucleus.jpa.PersistenceProviderImpl
- EclipseLink:
org.eclipse.persistence.jpa.PersistenceProvider
- 休眠:
org.hibernate.ejb.HibernatePersistence
- OpenJPA:
org.apache.openjpa.persistence.PersistenceProviderImpl
- TopLink Essentials:
oracle.toplink.essentials.PersistenceProvider
- DataNucleus:
org.datanucleus.jpa.PersistenceProviderImpl
- EclipseLink:
org.eclipse.persistence.jpa.PersistenceProvider
- Hibernate:
org.hibernate.ejb.HibernatePersistence
- OpenJPA:
org.apache.openjpa.persistence.PersistenceProviderImpl
- TopLink Essentials:
oracle.toplink.essentials.PersistenceProvider
这篇关于Java持久性API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!