[Hibernate] official tutorial - userguide
Persistence contexts
org.hibernate.Session API and javax.persistence.EntityManager API represent a context for dealing with persistent data. This concept is called apersistencec context. Persistent data has a state in relation to both a persistence context and the underlying database.
transient瞬时
The entity has just been instantiated and is not assocaiated with a persistence context.
It has no persistent representation in the database and typically no identifier value has been assigned(unless the assigned generator was used).
managed, or persistent 持久的]
实体有一个关联的标识符,并且和持久化上下文关联.
物理地存在或者不存在于数据库中.
detached 托管的,游离的
有关联的标识符,但是不再和持久化上下滑关联(通常因为持久化上下文被关闭或者实例被上下文清除.
removed
实体有关联的标识符并且和持久化上下文关联,然而它被计划从数据库中移除.
大多数org.hibernate.Session API and javax.persistence.EntityManager API的方法处理实体在这些状态之间的变动.
-------------从JPA中访问Hibernate APIs--------
Session session = entityManager.unwrap( Session.class );
SessionImplementor sessionImplementor = entityManager.unwrap( SessionImplementor.class );
SessionFactory sessionFactory = entityManager.getEntityManagerFactory().unwrap( SessionFactory.class );
----------------
[Hibernate] official tutorial - userguide的更多相关文章
- [转载] CMake Official Tutorial——教程还是官方的好
CMake官方教程传送门:https://cmake.org/cmake-tutorial/ 以下的内容跟官方教程基本一致,少数地方根据自己的测试有所改动: A Basic Starting Poin ...
- ROS->The Official Tutorial
系统安装 我的使用环境是Ubuntu 16.04LTS 32bit # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (2016 ...
- MySQL official tutorial
1.installation 2.setup environment variables add %/MySQL Server/bin to path. then restart cmd/powers ...
- TensorFlow tutorial
代码示例来自https://github.com/aymericdamien/TensorFlow-Examples tensorflow先定义运算图,在run的时候才会进行真正的运算. run之前需 ...
- Tutorial: Reverse debugging with GDB 7 (转载)
Tutorial: Reverse debugging with GDB 7 Tutorial: Reverse debugging with GDB 7 by Jay Conrod posted o ...
- JPA、Hibernate、Spring-Data-Jpa的本质区别
什么是JPA? 全称Java Persistence API,可以通过注解或者XML描述[对象-关系表]之间的映射关系,并将实体对象持久化到数据库中. 为我们提供了: 1)ORM映射元数据:JPA支持 ...
- Excellent Articles
Lisp The roots of lisp Recursive Functions of Symbolic Expressions and Their Computation by Machine, ...
- MyBlog
2016-06-25 一直想在搭建一个自己的blog.说来惭愧,cnblogs中的个人博客虽笔耕不辍,但杂乱无章.然而之前总是嘴上说说.现在,终于要行动起来了. 初步计划: 思路: django + ...
- Node.js 入门手册:那些最流行的 Web 开发框架
这篇文章与大家分享最流行的 Node.js Web 开发框架.Node 是一个服务器端 JavaScript 解释器,它将改变服务器应该如何工作的概念.它的目标是帮助程序员构建高度可伸缩的应用程序,编 ...
随机推荐
- Gym 101194C / UVALive 7899 - Mr. Panda and Strips - [set][2016 EC-Final Problem C]
题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?opti ...
- Gym 101873G - Water Testing - [皮克定理]
题目链接:http://codeforces.com/gym/101873/problem/G 题意: 在点阵上,给出 $N$ 个点的坐标(全部都是在格点上),将它们按顺序连接可以构成一个多边形,求该 ...
- Compile caffe on unbutu 16.0.4
1. apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhd ...
- 全文索引&&地理空间索引
Ⅰ.全文索引 搜索引擎的实现核心技术,搜索类似where col like '%xxx%';关键字可以出现再某个列任何位置 这种查询条件,B+ tree索引是无法使用的.如果col上创建了索引,因为排 ...
- HomeBrew及HomeBrew Cask的简介和使用
前言: 最近在Mac终端上安装SVN时用到了HomeBrew工具,虽然常用,但平时没有过多了解,特翻阅了资料总结一下,以便遗忘. 目录结构: 1. 什么是HomeBrew 2. HomeBrew的主要 ...
- centos6 安装python2.7 并做软件兼容处理 及 MySQLdb模块安装
相关软件准备 https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz https://pypi.org/project/setuptool ...
- Spring的bean管理(注解方式)
注解:代码中的特殊标记,注解可以使用在类.方法.属性上面,使用注解可实现一些基本的功能.注解的写法是@注解名称(属性=属性值). 使用注解创建对象 第一步,创建Web项目,引入Spring的开发包 第 ...
- android 知识汇总
1.assets:不会在R.java文件下生成相应的标记,assets文件夹可以自己创建文件夹,必须使用AssetsManager类进行访问,存放到这里的资源在运行打包的时候都会打入程序安装包中, 2 ...
- android studio相关配置
启动出现:Unable to access Android SDK add-on list 解决: Android Studio First Run 检测 Android SDK 及更新,由于众所周知 ...
- python基础(十三) cmd命令调用
python cmd命令调用 关于python调用cmd命令: 主要介绍两种方式: 1.python的OS模块. OS模块调用CMD命令有两种方式:os.popen(),os.system(). 都是 ...