将 JPA Ecliselink 应用程序转换为 Spring JPA
Converting JPA Ecliselink Application to Spring JPA
我有a project developed with JSF, JPA with EclipseLink. There is a need to have a complex query which is described in 。根据答案,似乎只能用 Spring JPA 来实现,因为它需要规范。 google 搜索没有提供任何关于如何将 JPA+EclipseLink 应用程序转换为 SpringJPA 的 link。我怎样才能实现转换?
Spring Data JPA 的规范只是一种动态创建 Predicate
实例并传递它们的方法。
无论您尝试创建什么查询,只需使用条件 API。
此外,从使用 EclipseLink 的 JPA 迁移到 Spring Data JPA 只是将 Spring Data JPA 添加到您的类路径并按照许多教程中的描述对其进行配置。
然后,您可以在任何 Spring Bean 中注入 Repository
。
这里的问题将是更多的 JSF,它需要一些调整才能很好地与 Spring https://docs.spring.io/spring-webflow/docs/current/reference/html/spring-faces.html 一起工作
但同样,如果这只是几个甚至单个查询,则您不需要。
我有a project developed with JSF, JPA with EclipseLink. There is a need to have a complex query which is described in
Spring Data JPA 的规范只是一种动态创建 Predicate
实例并传递它们的方法。
无论您尝试创建什么查询,只需使用条件 API。
此外,从使用 EclipseLink 的 JPA 迁移到 Spring Data JPA 只是将 Spring Data JPA 添加到您的类路径并按照许多教程中的描述对其进行配置。
然后,您可以在任何 Spring Bean 中注入 Repository
。
这里的问题将是更多的 JSF,它需要一些调整才能很好地与 Spring https://docs.spring.io/spring-webflow/docs/current/reference/html/spring-faces.html 一起工作
但同样,如果这只是几个甚至单个查询,则您不需要。