没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论


















JAVA PERSISTENCE
API (JPA)
Tutorial

JAVA PERSISTENCE API (JPA)
2
Simply Easy Learning

JAVA PERSISTENCE API (JPA)
3
About the Tutorial
This tutorial provides a basic understanding of how to store a copy of database objects
into temporary memory using JAVA Persistence API (JPA).
Audience
This tutorial is designed for readers intend to do Java programing with Database
connectivity, using Persistence API.
Prerequisites
Awareness of Java programming with JDK 1.6 or later is a prerequisite to understand
this tutorial. In addition, we assume the readers are acquainted with the concepts of
JDBC in Java.
Copyright & Disclaimer
Copyright 2014 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point
(I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or
republish any contents or a part of contents of this e-book in any manner without written
consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely
as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I)
Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of
our website or its contents including this tutorial. If you discover any errors on our
website or in this tutorial, please notify us at contact@tutorialspoint.com .

JAVA PERSISTENCE API (JPA)
4
Table of Contents
About the Tutorial .................................................................................................................................... 3
Audience ................................................................................................................................................... 3
Prerequisites ............................................................................................................................................. 3
Copyright & Disclaimer ............................................................................................................................. 3
Table of Contents ...................................................................................................................................... 4
1. JPA – INTRODUCTION ........................................................................................................... 7
Mismatch between Relational and Object Models .................................................................................... 7
What is JPA? ............................................................................................................................................. 7
Where to use JPA? .................................................................................................................................... 7
JPA History ................................................................................................................................................ 8
JPA Providers ............................................................................................................................................ 8
2. JPA – ARCHITECTURE ............................................................................................................ 9
Class Level Architecture ............................................................................................................................ 9
JPA Class Relationships ........................................................................................................................... 10
3. JPA – ORM COMPONENTS .................................................................................................. 12
Object Relational Mapping ..................................................................................................................... 12
Advanced Features ................................................................................................................................. 12
ORM Architecture ................................................................................................................................... 12
Mapping.xml ........................................................................................................................................... 14
Annotations ............................................................................................................................................ 17
Java Bean Standard ................................................................................................................................. 19
Bean Conventions ................................................................................................................................... 19
4. JPA – INSTALLATION ............................................................................................................ 21

JAVA PERSISTENCE API (JPA)
5
Step 1 : Verify your Java Installation ....................................................................................................... 21
Step 2 : Set your Java Environment ......................................................................................................... 22
Step 3 : Installing JPA .............................................................................................................................. 22
Adding MySQL connector to the Project ................................................................................................. 27
5. JPA – ENTITY MANAGERS .................................................................................................... 29
Creating Entities ...................................................................................................................................... 30
Persistence Operations ........................................................................................................................... 34
Create Employee ..................................................................................................................................... 34
Update Employee ................................................................................................................................... 35
Deleting Employee .................................................................................................................................. 38
6. JPA – JPQL ........................................................................................................................... 40
Java Persistence Query language ............................................................................................................ 40
Query Structure ...................................................................................................................................... 40
Scalar and Aggregate Functions .............................................................................................................. 41
Between, And, Like Keywords ................................................................................................................. 43
Ordering ................................................................................................................................................. 45
Named Queries ....................................................................................................................................... 46
Eager and Lazy Fetching .......................................................................................................................... 50
7. JPA – ADVANCED MAPPINGS .............................................................................................. 51
Inheritance Strategies ............................................................................................................................. 51
Single Table strategy ............................................................................................................................... 51
Joined Table Strategy .............................................................................................................................. 58
Table per Class Strategy .......................................................................................................................... 66
8. JPA – ENTITY RELATIONSHIPS .............................................................................................. 74
@ManyToOne Relation ........................................................................................................................... 74
剩余112页未读,继续阅读
资源评论


m0_37710887
- 粉丝: 0
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 用友软件在日常核算中常见问题【会计实务操作教程】.pptx
- 专题讲座资料(2021-2022年)关于近年来信息化工作情况的汇报.docx
- 加强网络信息安全的建议书.docx
- 网络购物项目可行性报告.doc
- 计算机组装与维护(第二版)-项目1-任务6声音系统.pptx
- 数据挖掘项目Python——银行对中小微企业信贷策略的关键技术应用
- 中国网络零售现状调研报告.pptx
- 综合布线系统布线系统测试与工.pptx
- 如何撰写项目管理专业论文.ppt
- 人工神经网络-专题知识专家讲座.pptx
- 通信技术在生活中的作用.doc
- 电子商务脱贫奔康自查报告.docx
- 微软(中国)有限公司的简历挑选方法.pdf
- 网络服务协议标准版.doc
- (源码)基于Node.js的多平台自动签到系统.zip
- 基于PLC的自动洗车控制系统(DOC).doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
