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的更多相关文章

  1. [转载] CMake Official Tutorial——教程还是官方的好

    CMake官方教程传送门:https://cmake.org/cmake-tutorial/ 以下的内容跟官方教程基本一致,少数地方根据自己的测试有所改动: A Basic Starting Poin ...

  2. ROS->The Official Tutorial

    系统安装 我的使用环境是Ubuntu 16.04LTS 32bit # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (2016 ...

  3. MySQL official tutorial

    1.installation 2.setup environment variables add %/MySQL Server/bin to path. then restart cmd/powers ...

  4. TensorFlow tutorial

    代码示例来自https://github.com/aymericdamien/TensorFlow-Examples tensorflow先定义运算图,在run的时候才会进行真正的运算. run之前需 ...

  5. Tutorial: Reverse debugging with GDB 7 (转载)

    Tutorial: Reverse debugging with GDB 7 Tutorial: Reverse debugging with GDB 7 by Jay Conrod posted o ...

  6. JPA、Hibernate、Spring-Data-Jpa的本质区别

    什么是JPA? 全称Java Persistence API,可以通过注解或者XML描述[对象-关系表]之间的映射关系,并将实体对象持久化到数据库中. 为我们提供了: 1)ORM映射元数据:JPA支持 ...

  7. Excellent Articles

    Lisp The roots of lisp Recursive Functions of Symbolic Expressions and Their Computation by Machine, ...

  8. MyBlog

    2016-06-25 一直想在搭建一个自己的blog.说来惭愧,cnblogs中的个人博客虽笔耕不辍,但杂乱无章.然而之前总是嘴上说说.现在,终于要行动起来了. 初步计划: 思路: django + ...

  9. Node.js 入门手册:那些最流行的 Web 开发框架

    这篇文章与大家分享最流行的 Node.js Web 开发框架.Node 是一个服务器端 JavaScript 解释器,它将改变服务器应该如何工作的概念.它的目标是帮助程序员构建高度可伸缩的应用程序,编 ...

随机推荐

  1. TensorRT层和每个层支持的精度模式

    下表列出了TensorRT层和每个层支持的精确模式.它还列出了该层在深度学习加速器(DLA)上运行的能力.有关附加约束的更多信息,请参见 DLA Supported Layershttps://doc ...

  2. 1.7Oob 静态成员

    1)public class Exse3 { static int iCounter = 0; String name; boolean bGender = false; int iAge; doub ...

  3. jstl 与 el表达式

    jar下载地址参考:https://blog.csdn.net/qq_30062589/article/details/80224080 <%@ page language="java ...

  4. python3 使用libvirt 相关安装

    1.Linux下有Python2的环境下安装Python3参考: https://www.cnblogs.com/kimyeee/p/7250560.html 2.安装完Python3后,将/usr/ ...

  5. GitHub的操作

    一.查看自己的信息:git config --list 修改config文件:01.输入vim ~/.gitconfig(回车) 02.点击 i.o或a 进入编辑模式 03.修改所要修改的信息 04. ...

  6. java框架之SpringCloud(4)-Ribbon&Feign负载均衡

    在上一章节已经学习了 Eureka 的使用,SpringCloud 也提供了基于 Eureka 负载均衡的两种方案:Ribbon 和 Feign. Ribbon负载均衡 介绍 SpringCloud ...

  7. [OpenCV]直线拟合

    OpenCV实现了直线的拟合. CV_IMPL void cvFitLine( const CvArr* array, int dist, double param, double reps, dou ...

  8. python基础之 while 逻辑运算符 格式化输出等

    1.while循环 while 条件: 循环体 while 条件: 循环体 else: 循环体 重点: 当条件为真的时候,就进入循环体,从上到下依次执行,执行完最后一条语句时,while并不是直接退出 ...

  9. Objective-C RunTime 学习笔记 之 基础结构体

    1.OC 运行期常用对象结构体 基本的结构体定义 typedef objc_class Class; /* 类 */ typedef objc_object *id; /* 各种类型,只要第一个字段为 ...

  10. Kubernetes外挂配置管理—ConfigMap介绍

    目录贴:Kubernetes学习系列 其他容器编排调度工具会大谈特谈“轻应用”.“十二要素应用”,这样就势必会对企业级复杂应用做很大的改动.Kubernetes是为了解决“如何合理使用容器支撑企业级复 ...