Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
查看 spring + hibernateJPA 教程,我注意到persistence.xml 中没有定义实体。那么在我们将spring(3.0.x)添加到混合中的情况下,这个实体检测究竟是如何工作的?
长话短说,JPA 的 EntityManagerFactory 将扫描您的类路径以查找带有@Entity注释的类。JPQL 查询将根据这些类的元数据(字段)转换为原生 SQL 查询。
@Entity