使用连接表或路径表达式与JPQL和Hibernate具有相同的效果?

时间:2018-06-13 21:35:46

标签: java hibernate jpql

晚上好,

让我的pojo Athor成为:

public class Author {
  private long id;
  private String name;

  @JoinColumn(name = "id", nullable = false)
  private Editor editor;
}

我想知道使用Hibernate这两个JPQL查询之间是否存在性能,执行等差异:

select a.name, b.name from Author a inner join a.editor e where a.id = 1;

select a.name, a.editor.name from Athor a where a.id = 1;

谢谢!

0 个答案:

没有答案