====== JPA 2.1 ====== * [[http://www.thoughts-on-java.org/jpa-21-overview/|JPA 2.1 Overview]] ===== Entity Graph ===== * [[http://www.javacodegeeks.com/2014/11/jpa-entity-graphs.html|JPA Entity Graphs]] : Hibernate **Fetch Profiles** 같은 것. * [[http://www.radcortez.com/jpa-entity-graphs/|JPA Entity Graphs]] ===== Named Query ===== * [[http://www.thoughts-on-java.org/define-named-queries-runtime-jpa-2-1/|How to define named queries at runtime with JPA 2.1]] ===== Bulk update/delete ===== * [[http://www.thoughts-on-java.org/criteria-updatedelete-easy-way-to/|Criteria Update/Delete - The easy way to implement bulk operations in JPA 2.1]] ===== JPQL ===== * [[https://www.javacodegeeks.com/2016/02/jpql-enhancements-jpa-2-1-java-ee-7-part-1-join.html|JPQL Enhancements in JPA 2.1 and Java EE 7 (part 1 – JOIN ON)]] ===== funcntion 으로 native function 호출 ===== * [[https://thorben-janssen.com/database-functions/|How to call custom database functions with JPA and Hibernate]] * [[java:hibernate|Hibernate]] 를 구현체로 사용시에 항상 dialect 에 해당 function이 등록돼 있어야 한다. ==== dialect 등록 ==== public class MyPostgreSQL9Dialect extends PostgreSQL94Dialect { public MyPostgreSQL9Dialect() { super(); registerFunction("calculate", new StandardSQLFunction("calculate")); } } ==== JPQL 에서 호출 ==== Author a = em.createQuery("SELECT a FROM Author a WHERE a.id = function('calculate', 1, 2)", Author.class).getSingleResult();