DATAJPA-176 - Introduce Querydsl abstraction.

Introduced Querydsl helper class to allow using more functionality from QuerydslJpaRepository as well as QuerydslRepositorySupport. Moved applyPagination(…) and applySorting(…) methods into that helper class. Removed QuerydslUtils and moved functionality into Querydsl helper.

This change breaks exposed API in Querydsl repo and repo support classes.
This commit is contained in:
Oliver Gierke
2012-06-04 16:33:58 +02:00
parent fe47b145b7
commit 4c1a1450b9
6 changed files with 187 additions and 131 deletions

View File

@@ -24,6 +24,7 @@ import javax.persistence.PersistenceContext;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.sample.User;
import org.springframework.data.jpa.repository.support.QueryDslRepositorySupportTests.UserRepository;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -63,6 +64,10 @@ public class QueryDslRepositorySupportIntegrationTests {
static class ReconfiguringUserRepositoryImpl extends QueryDslRepositorySupport {
public ReconfiguringUserRepositoryImpl() {
super(User.class);
}
@Override
@PersistenceContext(unitName = "querydsl")
public void setEntityManager(EntityManager entityManager) {

View File

@@ -127,6 +127,10 @@ public class QueryDslRepositorySupportTests {
private static final QUser user = QUser.user;
public UserRepositoryImpl() {
super(User.class);
}
@Override
@PersistenceContext(unitName = "default")
public void setEntityManager(EntityManager entityManager) {