- 浏览: 2977218 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (2529)
- finance (1459)
- technology (218)
- life (343)
- play (150)
- technology-component (0)
- idea (6)
- house (74)
- health (75)
- work (32)
- joke (23)
- blog (1)
- amazing (13)
- important (22)
- study (13)
- Alternative (0)
- funny (8)
- stock_technology (12)
- business (16)
- car (21)
- decorate (4)
- basketball (2)
- English (16)
- banker (1)
- TheBest (1)
- sample (2)
- love (13)
- management (4)
最新评论
-
zhongmin2012:
BSM确实需要实践,标准ITIL服务流程支持,要做好,需要花费 ...
BSM实施之前做什么 -
shw340518:
提示楼主,有时间逻辑bug:是你妈二十那年写的 那会儿连你爹都 ...
80后辣妈给未来儿子的信~我的儿,你也给我记住了~~~ -
guoapeng:
有相关的文档吗?
it项目管理表格(包含146个DOC文档模板) -
solomon:
看到的都是 这种 CTRL+C 和 CTRL+V 的文章, ...
Designing a website with InfoGlue components -
wendal:
恩, 不错. 有参考价值
Designing a website with InfoGlue components
On this tutorial we will demonstrate how to setup Struts 2 in Eclipse, and make it work with Spring, Java Persistence API (using Hibernate) and Struts 2 Ajax tags.
NOTE: Following this tutorial verbatim will require use of a Struts 2 deployment greater than 2.0.3
Show me the code
You can just download the zipped Eclipse project, add the required dependencies to the lib folder under the /WebContent/WEB-INF/lib folder (relative to project's root folder) and import it into Eclipse.
Prerequisites
- Struts 2
- Tomcat 5.5
- Eclipse
- Eclipse WTP
- Hibernate Core
- Hibernate Annotations
- Hibernate Entity Manager
- MySql Server
- Mysql JDBC Driver
- Spring 2.0
Tomcat
Install Tomcat before going forward. See Tomcat's installation guide if you have any problem installing it.
MySql
Install and configure MySql. Create a database named "quickstart" and run the script below to create the "Person" table. Later, on applicationContext.xml, we'll use 'root' as the user name and password for the database, remember to replace those values with the right ones for your database.
CREATE TABLE 'quickstart'.'Person' ( 'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'firstName' VARCHAR(45) NOT NULL, 'lastName' VARCHAR(45) NOT NULL, PRIMARY KEY('id') ) ENGINE = InnoDB;
Create Eclipse project
- Open Eclipse. Seriously, you need to open Eclipse.
- Click File -> New -> Project. Under the "Web" folder, select "Dynamic Web Project" and click "Next".
- Enter the project name, "quickstart" from here on. The project will be running inside Tomcat, so we need to create a server configuration for it.
- Under "Target Runtime", click "New", select "Apache Tomcat 5.5" and click next.
- Enter Tomcat's installation directory and select an installed JRE (1.5 is required)
- Now you should be back to the project creation wizard, with Tomcat as your Target Runtime. Click "Next". Select "Dynamic Web Module" and "Java" facets, and click "Finish".
Dependencies
Your project should contain the folders "src", "build" and "WebContent". We are going to put all the required jars under "/WebContent/WEB-INF/lib". To add files to the "lib" folder, just copy them to ${workspace}\quickstart\WebContent\WEB-INF\lib, where ${workspace} is the location of your Eclipse workspace folder. The version has been removed from the jar files.
xwork.jar | Struts 2 |
struts2-api.jar | Struts 2 |
struts2-core.jar | Struts 2 |
struts2-Spring-plugin.jar | Struts 2 |
ognl.jar | Struts 2 |
freemarker-2.3.4.jar | Struts 2 |
mysql-connector-java.jar | MySql JDBC Driver |
spring.jar | Sping 2.0 |
antlr.jar | Hibernate Core |
asm.jar | Hibernate Core |
asm-attrs.jar | Hibernate Core |
cglib.jar | Hibernate Core |
dom4j.jar | Hibernate Core |
jdbc2_0-stdext.jar | Hibernate Core |
ehcache.jar | Hibernate Core |
hibernate3.jar | Hibernate Core |
xml-apis.jar | Hibernate Core |
commons-collections.jar | Hibernate Core |
ejb3-persistence.jar | Hibernate Annotations |
jta.jar | Hibernate Annotations |
hibernate-annotations.jar | Hibernate Annotations |
hibernate-entitymanager.jar | Hibernate Entity Manager |
javassist.jar | Hibernate Entity Manager |
jboss-archive-browsing.jar | Hibernate Entity Manager |
Right click on the project and select "Refresh" (to notify Eclipse of the jars that we just added).
Domain
Our domain model will consist of just a simple "Person" class with a couple of fields.
- Create a new class named "Person" (File -> New -> Class), and enter "quickstart.model" for the package name.
- Add the fields "id" (int), "firstName" (String), and lastName ("String") with their setter/getter methods.
- Mark your class with the "@Entity" annotation, and the "id" field with the annotations "@Id" and "@GeneratedValue".
your class will look like:
package quickstart.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Person { @Id @GeneratedValue private Integer id; private String lastName; private String firstName; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } }
@Entity will let the provider know that this class can be persisted. @Id marks the "id" field as the primary key for this class. @GeneratedValue will cause the id field to be generated by the provider (Hibernate). Classes and fields are by default mapped to tables and columns with the same name, see JPA's documentation for more details.
Person service.
We will now write the class that will take care of CRUD operations on "Person" objects.
- Create a new interface (File -> New -> Interface), enter "PersonService" for the name, and "quickstart.service" for the namespace. Set its content to:
package quickstart.service; import java.util.List; import quickstart.model.Person; public interface PersonService { public List<Person> findAll(); public void save(Person person); public void remove(int id); public Person find(int id); }
- Create a new class (File -> New -> Class), enter "PersonServiceImpl" for the name and "quickstart.service" for the namespace. Set its content to:
package quickstart.service; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import org.springframework.transaction.annotation.Transactional; import quickstart.model.Person; @Transactional public class PersonServiceImpl implements PersonService { private EntityManager em; @PersistenceContext public void setEntityManager(EntityManager em) { this.em = em; } @SuppressWarnings("unchecked") public List<Person> findAll() { Query query = getEntityManager().createQuery("select p FROM Person p"); return query.getResultList(); } public void save(Person person) { if (person.getId() == null) { // new em.persist(person); } else { // update em.merge(person); } } public void remove(int id) { Person person = find(id); if (person != null) { em.remove(person); } } private EntityManager getEntityManager() { return em; } public Person find(int id) { return em.find(Person.class, id); } }
@PersistenceContext will make Spring inject an EntityManager into the service when it is instantiated. The @PersistenceContext annotation can be placed on the field, or on the setter method. If the class is annotated as @Transactional, Spring will make sure that its methods run inside a transaction.
JPA configuration
- Create a folder named "META-INF" under the "src" folder.
- Create a file named "persistence.xml" under the "META-INF" folder and set its content to:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="punit"> </persistence-unit> </persistence>
JPA configuration can be set on this file. On this example it will be empty because the datasource configuration will be on the Spring configuration file.
Spring
- Update the content of web.xml under /WebContent/WEB-INF/web.xml to:
<?xml version="1.0" encoding="UTF-8"?> <web-app id="person" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>person</display-name> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>
This will make the container redirect all requests to Struts "FilterDispatcher" class. "index.jsp" is set as the home page, and Spring's "ContextLoaderListener" is configured as a listener.
- Create a file named "applicationContext.xml" under /WebContent/WEB-INF, and set its content to:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> <bean id="personService" class="quickstart.service.PersonServiceImpl" /> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="database" value="MYSQL" /> <property name="showSql" value="true" /> </bean> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost/test" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="personAction" scope="prototype" class="quickstart.action.PersonAction"> <constructor-arg ref="personService" /> </bean> </beans>
Note that the "class" attribute of the bean "personAction" is set to the name of the action class, and the "personService" bean will be passed as a parameter to the action constructor. Change the "url", "username" and "password" in the "dataSource" bean to the appropiate values for your database. For more details on the rest of the beans on this file, see Spring's documentation. The "scope" attribute is new in Spring 2, and it means that Spring will create a new PersonAction object every time an object of that type is requested. In Struts 2 a new action object is created to serve each request, that's why we need scope="prototype".
Struts
We will now create a simple Struts action that wraps PersonServices methods, and we will configure Struts to use Spring as the object factory.
- Open the new class dialog (File -> New -> Class) and enter "PersonAction" for the classname, and "quickstart.action" for the namespace. Set its content to:
package quickstart.action; import java.util.List; import quickstart.model.Person; import quickstart.service.PersonService; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.Preparable; public class PersonAction implements Preparable { private PersonService service; private List<Person> persons; private Person person; private Integer id; public PersonAction(PersonService service) { this.service = service; } public String execute() { this.persons = service.findAll(); return Action.SUCCESS; } public String save() { this.service.save(person); this.person = new Person(); return execute(); } public String remove() { service.remove(id); return execute(); } public List<Person> getPersons() { return persons; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public void prepare() throws Exception { if (id != null) person = service.find(id); } public Person getPerson() { return person; } public void setPerson(Person person) { this.person = person; } }
Look mom my action is a simple POJO!
The "Preparable" interface instructs Struts to call the "prepare" method if the "PrepareInterceptor" is applied to the action (by default, it is). The constructor of the action takes a "PersonService" as a parameter, which Spring will take care of passing when the action is instatiated.
- Create a new file named "struts.xml" under the "src" folder. And set its content to:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.objectFactory" value="spring" /> <constant name="struts.devMode" value="true" /> <package name="person" extends="struts-default"> <action name="list" method="execute" class="personAction"> <result>pages/list.jsp</result> <result name="input">pages/list.jsp</result> </action> <action name="remove" class="personAction" method="remove"> <result>pages/list.jsp</result> <result name="input">pages/list.jsp</result> </action> <action name="save" class="personAction" method="save"> <result>pages/list.jsp</result> <result name="input">pages/list.jsp</result> </action> </package> </struts>
Setting "struts.objectFactory" to "spring" will force Struts to instantiate the actions using Spring, injecting all the defined dependencies on applicationContext.xml. The "class" attribute for each action alias is set to "personAction", which is the bean id that we defined on applicationContext.xml for the PersonAction class. This is all that is needed to make Struts work with Spring.
The pages
We only have two pages, "index.jsp" and "list.jsp". "list.jsp" returns a table with a list of the persons on the database.We have this list on a different page because we are going to add some AJAX to spicy it up.
- Create a new file named "list.jsp" under /WebContent/pages/ and set its content to:
<%@ taglib prefix="s" uri="/struts-tags"%> <p>Persons</p> <s:if test="persons.size > 0"> <table> <s:iterator value="persons"> <tr id="row_<s:property value="id"/>"> <td> <s:property value="firstName" /> </td> <td> <s:property value="lastName" /> </td> <td> <s:url id="removeUrl" action="remove"> <s:param name="id" value="id" /> </s:url> <s:a href="%{removeUrl}" theme="ajax" targets="persons">Remove</s:a> <s:a id="a_%{id}" theme="ajax" notifyTopics="/edit">Edit</s:a> </td> </tr> </s:iterator> </table> </s:if>
This is going to render a table with each row showing the first and last name of the person, a link to remove the person, and a link to edit. The remove link has the attribute "targets", set to "persons", which means that when the user clicks on it, an asynchronous request will be made to the "remove" action (as configured on struts.xml, "remove" points to the "remove" method in PersonAction), passing the person id as parameter.
When the edit link is clicked on, it will publish the "/edit" topic, which will trigger a javascript function to populate the fields.
- Create a new file named "index.jsp" under /WebContent and set its content to:
<%@ taglib prefix="s" uri="/struts-tags"%> <html> <head> <s:head theme="ajax" debug="true"/> <script type="text/javascript"> dojo.event.topic.subscribe("/save", function(data, type, request) { if(type == "load") { dojo.byId("id").value = ""; dojo.byId("firstName").value = ""; dojo.byId("lastName").value = ""; } }); dojo.event.topic.subscribe("/edit", function(data, type, request) { if(type == "before") { var id = data.split("_")[1]; var tr = dojo.byId("row_"+id); var tds = tr.getElementsByTagName("td"); dojo.byId("id").value = id; dojo.byId("firstName").value = dojo.string.trim(dojo.dom.textContent(tds[0])); dojo.byId("lastName").value = dojo.string.trim(dojo.dom.textContent(tds[1])); } }); </script> </head> <body> <s:url action="list" id="descrsUrl"/> <div style="width: 300px;border-style: solid"> <div style="text-align: right;"> <s:a theme="ajax" notifyTopics="/refresh">Refresh</s:a> </div> <s:div id="persons" theme="ajax" href="%{descrsUrl}" loadingText="Loading..." listenTopics="/refresh"/> </div> <br/> <div style="width: 300px;border-style: solid"> <p>Person Data</p> <s:form action="save" validate="true"> <s:textfield id="id" name="person.id" cssStyle="display:none"/> <s:textfield id="firstName" label="First Name" name="person.firstName"/> <s:textfield id="lastName" label="Last Name" name="person.lastName"/> <s:submit theme="ajax" targets="persons" notifyTopics="/save"/> </s:form> </div> </body> </html>
Look mom no page refresh!
The div "persons" will load its content asynchronously, and will show "Loading..." while while the request is on progress (you can use the "indicator" attribute for better progress feedback), you can force it to refresh clicking on the "Refresh" link. The "submit" button, will make an asynchronous request to the action "save" ("save" method on PersonAction), and will publish the topic "/save" to which we subscribed to, using "dojo.event.topic.subscribe", to clear the input fields.
Validation
Because we don't want any John Doe on our database, we will add some basic client side validation to our form. In Struts 2, validation can be placed on xml files with the name pattern ActionName-validation.xml, located on the same package as the action. To add validation to an specific alias of an action (like a method), the validation file name follows the pattern ActionName-alias-validation.xml, where "alias" is the action alias name (in this case a method name, "save"). Add a file named "PersonAction-save-validation.xml" under /src/quickstart/action, and set its content to:
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="person.firstName">
<field-validator type="requiredstring">
<message>First name is required!</message>
</field-validator>
</field>
<field name="person.lastName">
<field-validator type="requiredstring">
<message>Last name is required!</message>
</field-validator>
</field>
</validators>
See the Struts documentation for details on existing validators, and how to write, and plug in, your own validators.
To run the project, Right click on your project and Run As -> Run on Server. You can debug it on the same way, Right click on the project and Debug As -> Debug on Server. Download and install Struts 2 Showcase to see more examples.
References
发表评论
-
New Enterprise Security Solutions
2011-09-13 15:46 0<!-- [if !mso]> <styl ... -
ES Announces Enterprise Security Solutions
2011-09-13 15:40 0<!-- [if !mso]> <styl ... -
linux下如何将文件打包、压缩并分割成制定大小?
2010-09-15 18:52 3322将大文件或目录打包、 ... -
rhel4 yum安装, 使用
2010-09-07 16:37 0第一种方法: yum源来自chinalinuxpub.com ... -
Windows: 远程自动安装程序
2010-08-26 15:48 1121问题的提出 作为 ... -
Oracle体系结构
2010-08-07 09:53 1060Oracle体系结构 Oracle Server包括Oracl ... -
ocp sesson 3
2010-07-31 14:39 0show parameter undo 只有 默认情况下服务 ... -
ocp session 2
2010-07-25 17:00 0/home/oracle/raInventory/orains ... -
ocp session 1
2010-07-24 13:02 0ocp first lesson D:\oracle_cou ... -
Python的xmlrpc调试
2010-07-19 23:55 2155Python的xmlrpc 调 试 ----------- ... -
mdadm使用详解及RAID 5简单分析
2010-07-11 16:19 1412http://blog.csdn.net/chinalinux ... -
Linux的lvm的基本配置步骤
2010-07-11 14:53 12981.增加硬件 增加的ide硬盘前缀为hd,scs ... -
OCP study material
2010-07-11 13:52 0\\192.168.1.105watch -n 1 'stat ... -
apache+python+mod_python+django 编译安装指南
2010-06-24 17:25 14801、本文将知道你在 linux 下使用源码包安装 ... -
在ubuntu下配置apache运行python脚本
2010-06-22 16:11 2288常用的简单命令 sudo apt ... -
Python 2.5 Quick Reference
2010-06-21 11:18 1480... -
shell 面试题汇集
2010-06-10 19:50 1088利用 top 取某个进程的 CPU 的脚本 : ... -
shell程序面试题
2010-06-10 19:48 29581.要求分析Apache访问日志,找出里面数量在前面100位的 ... -
EMC技术支持工程师笔试部分试题回忆
2010-06-07 15:16 1664要查看更多EMC公司笔经相关信息,请访问EMC公司校园招聘CL ... -
linux shell 条件语句
2010-06-03 23:29 1816...
相关推荐
"good code for jpa example" 指的是一份展示了良好编程实践的JPA示例代码,可能是为了帮助开发者理解如何高效、正确地使用JPA。 在JPA中,我们通常会定义实体类(Entity),这些类代表数据库中的表。实体类需要...
**Java Persistence API (JPA)** 是Java平台上的一个标准,用于管理关系数据库中的对象-关系映射(ORM)。它提供了一种方式,让开发者可以用面向对象的编程模型来操作数据库,而无需直接编写SQL语句。JPA允许你在...
**JPA(Java Persistence API)**是Java平台上的一个标准,用于管理关系数据库中的数据,它简化了在Java应用程序中存储、检索和管理对象的工作。JPA是Java EE和Java SE环境中的一种ORM(Object-Relational Mapping)...
《Pro JPA2:精通Java™ Persistence API》是一本由Mike Keith和Merrick Schincariol撰写的关于Java持久化API(JPA)的权威指南。本书深入探讨了JPA2,即Java Persistence API的第二版,是Java EE 6标准的一部分。...
**Java Persistence API (JPA)** 是Java平台上的一个标准,用于管理关系数据库中的数据。它为Java开发者提供了一种对象关系映射(ORM)机制,将业务对象与数据库表进行映射,使得开发者可以使用面向对象的方式来操作...
Java Persistence API (JPA) 是Java企业版5(Java EE 5)的一部分,与Enterprise JavaBeans(EJB)3.0规范一起,极大地简化了Java持久化。它提供了一种对象关系映射方法,允许您以标准、可移植的方式声明性地定义...
Java Persistence API(JPA)是Java平台上的一个标准,用于管理关系数据库中的对象持久化。它简化了在Java应用程序中存储、检索和管理数据的过程,是Enterprise JavaBeans(EJB)的一部分,也是Spring框架中的一个...
Gemini JPA是在OSGi环境下(特别是Eclipse RCP)中使用的Java持久化框架。OSGi是一个模块化服务平台,允许在Java环境中动态地安装、启动、停止和卸载组件,而不会影响其他组件的正常运行。在Java开发中,持久化层...
Spring Data JPA 是一个由 Spring 框架提供的强大库,它极大地简化了基于 Java Persistence API (JPA) 的数据库访问。JPA 是 Java 平台上的标准 ORM(对象关系映射)规范,允许开发者使用面向对象的方式处理数据库...
标题与描述均提到了“JPA”,这指向的是Java Persistence API(Java持久化API),一个用于Java应用中的对象-关系映射(ORM)的标准。JPA允许开发人员将数据库表映射到Java对象,从而在应用程序中以面向对象的方式...
**JPA(Java Persistence API)**是Java平台上用于管理关系数据库的数据持久化标准API,它为应用程序提供了一种对象/关系映射工具,将关系数据库中的数据与Java类对象关联起来,使得开发者可以使用面向对象的方式来...
**JPA(Java Persistence API)简介** Java Persistence API(JPA)是Java平台上的一个标准,用于管理和持久化Java对象到关系数据库。它是Java EE和Java SE环境中处理对象关系映射(ORM)的一种规范,旨在简化...
Spring框架的核心特性包括依赖注入(DI)和面向切面编程(AOP),并且它还提供了对数据库操作的支持,这主要通过Spring Data JPA和Java Persistence API(JPA)实现。 Spring注解是Spring框架中的一大特色,它极大...
**Java 持久化 API(JPA)详解(一)** Java 持久化 API(Java Persistence API),简称 JPA,是 Java 平台上的一个标准,用于管理关系数据库中的数据。JPA 提供了一种面向对象的方式来操作数据库,使得开发人员...
### JPA概述与核心知识点详解 #### 一、JPA概览 JPA,全称Java Persistence API,作为Java EE 5.0平台标准的ORM(Object-Relational Mapping)规范,旨在解决对象持久化问题,使开发人员能更轻松地在Java应用程序...
**Spring Data JPA** 是一个基于 **Java** 的开源框架,它是 **Spring Framework** 的一个模块,主要用于简化 **Java Persistence API (JPA)** 的使用。JPA 是 Java 平台上的一个标准,用于管理和持久化应用程序的...
Spring Data JPA API。 Spring Data JPA 开发文档。 官网 Spring Data JPA API。
A one-of-a-kind resource, this in-depth book provides both theoretical and practical coverage of JPA usage for experienced Java developers. Authors Mike Keith, Merrick Schincariol and Massimo Nardone...
### JPA概述与关键技术 #### 一、JPA简介 JPA(Java Persistence API)作为Java EE 5.0平台标准的ORM(Object-Relational Mapping)规范,旨在简化对象持久化开发工作并促进ORM技术的标准化。它吸取了EJB规范早期...