diff --git a/src/main/java/org/springframework/data/jpa/repository/QueryDslPredicateExecutor.java b/src/main/java/org/springframework/data/jpa/repository/QueryDslPredicateExecutor.java deleted file mode 100644 index 7fd3d8294..000000000 --- a/src/main/java/org/springframework/data/jpa/repository/QueryDslPredicateExecutor.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2008-2011 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.jpa.repository; - -import java.util.List; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - -import com.mysema.query.types.OrderSpecifier; -import com.mysema.query.types.Predicate; - - -/** - * Interface to allow execution of QueryDsl {@link Predicate} instances. - * - * @author Oliver Gierke - */ -public interface QueryDslPredicateExecutor { - - /** - * Returns a single entity matching the given {@link Predicate}. - * - * @param spec - * @return - */ - T findOne(Predicate predicate); - - - /** - * Returns all entities matching the given {@link Predicate}. - * - * @param spec - * @return - */ - List findAll(Predicate predicate); - - - /** - * Returns all entities matching the given {@link Predicate} applying the - * given {@link OrderSpecifier}s. - * - * @param predicate - * @param orders - * @return - */ - List findAll(Predicate predicate, OrderSpecifier... orders); - - - /** - * Returns a {@link Page} of entities matching the given {@link Predicate}. - * - * @param predicate - * @param pageable - * @return - */ - Page findAll(Predicate predicate, Pageable pageable); - - - /** - * Returns the number of instances that the given {@link Predicate} will - * return. - * - * @param predicate the {@link Predicate} to count instances for - * @return the number of instances - */ - long count(Predicate predicate); -} diff --git a/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java b/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java index c197576fd..6eebe393e 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java @@ -21,10 +21,10 @@ import java.io.Serializable; import javax.persistence.EntityManager; -import org.springframework.data.jpa.repository.QueryDslPredicateExecutor; import org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy; import org.springframework.data.jpa.repository.query.QueryExtractor; import org.springframework.data.jpa.repository.utils.JpaClassUtils; +import org.springframework.data.querydsl.QueryDslPredicateExecutor; import org.springframework.data.repository.query.QueryLookupStrategy; import org.springframework.data.repository.query.QueryLookupStrategy.Key; import org.springframework.data.repository.support.RepositoryFactorySupport; diff --git a/src/main/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepository.java b/src/main/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepository.java index 25001695e..11aa01629 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepository.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepository.java @@ -25,8 +25,8 @@ import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Order; -import org.springframework.data.jpa.repository.QueryDslPredicateExecutor; import org.springframework.data.querydsl.EntityPathResolver; +import org.springframework.data.querydsl.QueryDslPredicateExecutor; import org.springframework.data.querydsl.SimpleEntityPathResolver; import com.mysema.query.jpa.JPQLQuery; diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java index 167d45b70..725f4e075 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java @@ -31,9 +31,9 @@ import org.mockito.runners.MockitoJUnitRunner; import org.springframework.aop.framework.Advised; import org.springframework.data.jpa.domain.sample.User; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.QueryDslPredicateExecutor; import org.springframework.data.jpa.repository.custom.CustomGenericJpaRepositoryFactory; import org.springframework.data.jpa.repository.custom.UserCustomExtendedRepository; +import org.springframework.data.querydsl.QueryDslPredicateExecutor; import org.springframework.data.repository.support.DefaultRepositoryMetadata; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +51,7 @@ public class JpaRepositoryFactoryUnitTests { @Mock EntityManager entityManager; @Mock + @SuppressWarnings("rawtypes") JpaEntityInformation metadata;