内容简介:Hibernate ORM 5.4.0 的第一个候选版本已发布。 更新内容 改进 EntityGraph JPA 的 EntityGraph 功能定义和使用起来很麻烦。Hibernate ORM 5.4 增加了2个新功能,可帮助您更轻松地使用 EntityGraphs。请注意,所有...
Hibernate ORM 5.4.0 的第一个候选版本已发布。
更新内容
改进 EntityGraph
JPA 的 EntityGraph 功能定义和使用起来很麻烦。Hibernate ORM 5.4 增加了2个新功能,可帮助您更轻松地使用 EntityGraphs。请注意,所有这些改进都被视为孵化阶段。
EntityGraph 的解析功能
第一个功能是能够从 String 创建图形。例如,给定一个 Person 实体,我们可能想要确保这个 person 的 spouse 可被快速地取出:
final EntityGraph eg = org.hibernate.graph.EntityGraphs.parse( Person.class, "spouse", entityManager ); final Person personAndSpouse = entityManager.find( Person.class, 1, Collections.singletonMap( "javax.persistence.fetchgraph", eg );
此解析支持 EntityGraph 创建的所有功能,包括子图和子类图。有关深入讨论和示例,请参阅文档。
EntityGraph 的操作功能
This is mainly about combining graphs. E.g.
final EntityGraph eg1 = org.hibernate.graph.EntityGraphs.parse( Person.class, "spouse", entityManager ); final EntityGraph eg2 = org.hibernate.graph.EntityGraphs.parse( Person.class, "spouse(age, dob)", entityManager ); final EntityGraph combinedGraph = org.hibernate.graph.EntityGraphs.merge( entityManager, Person.class, eg1, eg2 ) final Person personAndSpouse = entityManager.find( Person.class, 1, Collections.singletonMap( "javax.persistence.fetchgraph", combinedGraph );
This is a very trivial example meant just for illustration. It can actually be much more easily defined as:
final EntityGraph combinedGraph = org.hibernate.graph.EntityGraphs.parse( Person.class, "spouse( age, dob )", entityManager ); final Person personAndSpouse = entityManager.find( Person.class, 1, Collections.singletonMap( "javax.persistence.fetchgraph", combinedGraph );
支持 JDK 11
5.4.0 支持开箱即用的 JDK 11,例如,不需要 5.3 中所需的其他依赖项或环境变量。
Bug fixes 和其他小改进
此版本包含许多错误修正和小的改进。
获取 5.4.0.CR1
http://hibernate.org/orm/releases/5.4/#get-it
What's next?
将在未来几周内发布 5.4.0.Final,并在此后发布定期维护版本。
详情 http://in.relation.to/2018/11/15/hibernate-orm-540-cr1-out/
【声明】文章转载自:开源中国社区 [http://www.oschina.net]
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
数学与生活(修订版)
[日] 远山启 / 吕砚山、李诵雪、马杰、莫德举 / 人民邮电出版社 / 2014-10 / 42.00元
数学是高等智慧生物的共有思维,是对真理的探索,对矛盾的怀疑,但它绝非一门晦涩难懂的学问,非应试目的的数学是纯粹而朴实的智慧。《数学与生活》为日本数学教育改革之作,旨在还原被考试扭曲的数学,为读者呈现数学的真正容颜,消除应试教学模式带来的数学恐惧感。 本书既包含了初等数学的基础内容,又包含了微分、积分、微分方程、费马定理、欧拉公式等高等数学的内容。作者运用了多个学科的知识。结合日常生活和东西方......一起来看看 《数学与生活(修订版)》 这本书的介绍吧!