Java – does spring data JPA need eclipse links and Hibernate?
I've changed spring data from 1.7 1 upgrade to 1.9 0 and get dependencies and compilation errors immediately:
For various reasons (technical and political), we use eclipse link as a JPA provider However, it seems that org springframework. data. jpa. provider. The persistenceprovider class now contains static references to hibernate and open JPA classes
import org.apache.openjpa.enhance.PersistenceCapable; import org.apache.openjpa.persistence.OpenJPAPersistence; import org.apache.openjpa.persistence.OpenJPAQuery; import org.apache.openjpa.persistence.jdbc.FetchDirection; import org.apache.openjpa.persistence.jdbc.JDBCFetchPlan; import org.apache.openjpa.persistence.jdbc.LRSSizeAlgorithm; import org.apache.openjpa.persistence.jdbc.ResultSetType; import org.eclipse.persistence.jpa.JpaQuery; import org.eclipse.persistence.queries.ScrollableCursor; import org.hibernate.ScrollMode; import org.hibernate.ScrollableResults; import org.hibernate.ejb.HibernateQuery;
I'm confused - I can't find any references to hibernate's exclusive JPA provider right now Do we have to include hibernate and eclipse links (or chunks of bin eclipse links and rewriting other code) to use 1.9?
Solution
No, it's not necessary These classes are only used at runtime when you really use openjpa or hibernate as persistence provider In addition, the use of all three provider classes already exists in 1.7.1 of this class 1, so you may encounter this problem earlier
Did you change any compiler options while upgrading? I sometimes get this error, but for me it's just a warning, so if you increase the error level of such compiler warnings, this may be the reason