I have a project developed with JSF, JPA with EclipseLink. There is a need to have a complex query which is described in this question. According to the answer, it seems that it can only be achieved with Spring JPA as it needs Specifications. The google search did not give any link as to how a JPA+EclipseLink application can be converted to a SpringJPA. How can I achieve the conversion?
Asked
Active
Viewed 40 times
-1

Kukeltje
- 12,223
- 4
- 24
- 47

Buddhika Ariyaratne
- 2,339
- 6
- 51
- 88
-
As I see, spring-data-jpa uses as default hibernate as OR-Mapping-layer. So perhaps you should first lookup migration from eclipselink to hibernate. Or, how to use eclipselink in spring. – aschoerk Oct 01 '19 at 10:17
1 Answers
2
Specifications of Spring Data JPA are just a way of dynamically creating Predicate
instances and passing them around.
Whatever query you are trying to create you can do it by just using the Criteria API.
Also the move from JPA with EclipseLink to Spring Data JPA is just that of adding Spring Data JPA to your classpath and configuring it as it is described in many tutorials.
You can then inject a Repository
in any Spring Bean.
The problem here will be more JSF which would need some tweaking to work nicely with Spring https://docs.spring.io/spring-webflow/docs/current/reference/html/spring-faces.html
But again if this is just about a few or even a single query you don't need to.

Jens Schauder
- 77,657
- 34
- 181
- 348