[英]Spring and persistence.xml
在查看spring + hibernateJPA教程时,我注意到persistence.xml中没有定义实体,因此在向混合物中添加spring(3.0.x)的情况下,这种实体检测的工作原理是什么?
Long story short, JPA's EntityManagerFactory will scan your classpath for classes decorated with @Entity
annotation. 长话短说,JPA的EntityManagerFactory会在您的类路径中扫描以
@Entity
注释修饰的类。 JPQL queries will be translated into native SQL queries based on metadata (fields) of these classes. JPQL查询将基于这些类的元数据(字段)转换为本地SQL查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.