【发布时间】:2018-09-06 22:20:52
【问题描述】:
我都知道
EntityManager.createQuery("select e from Entity e where e.id = :id")
和:
EntityManager.find(Entity.class,id)
返回相同的结果,但我真的很想知道它们之间的区别。
【问题讨论】:
-
如果实体已经加载到一级缓存中,em.find() 不会执行任何查询。
标签: hibernate jpa eclipselink hql jpql