1 / 10
文档名称:

JPA技术总结.pptx

格式:pptx   大小:128KB   页数:10页
下载后只包含 1 个 PPTX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

JPA技术总结.pptx

上传人:cai.li.bin 2017/11/5 文件大小:128 KB

下载得到文件列表

JPA技术总结.pptx

相关文档

文档介绍

文档介绍:其实例表示对对数据库的连接
<?xml version="" encoding="UTF-8"?>
<persistence version=""
xmlns="http://java./xml/ns/persistence"
xmlns:xsi="1/XMLSchema-instance"
xsi:schemaLocation="http://java./xml/ns/persistence http://java./xml/ns/persistence/">
<persistence-unit name="JPA_Hibernate">
<.</provider>
<.</class>
<properties>
<property name="" value=""/>
<property name=""
value="jdbc:sqlserver://localhost:1433;DatabaseName=BS_DLERP;SelectMethod=Cursor"/>
<property name="" value="sa"/>
<property name="" value="111111"/>
<property name="" value=""/>
<property name="" value="true"/>
</properties>
</persistence-unit>
<persistence-unit name="JPA_OpenJPA">
……..
</persistence-unit>
</persistence>
Persistence
EntityManagerFactory
EntityManager
EntityTransaction
Query

其实例代表对数据库的一个连接。
一个数据库连接中最多只能有一个活动的事务对象—EntityTransaction。
EntityManager em = ();
try
{
// TODO: Use the EntityManager to access the database
}
Finally
{
();
}
Persistence
EntityManagerFactory
EntityManager
EntityTransaction
Query
Ent