DATACMNS-62 - Adapt changes in Spring Data Commons.
This commit is contained in:
@@ -103,16 +103,14 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
|
||||
|
||||
protected JpaQueryExecution getExecution() {
|
||||
|
||||
switch (method.getType()) {
|
||||
|
||||
case COLLECTION:
|
||||
if (method.isCollectionQuery()) {
|
||||
return new CollectionExecution();
|
||||
case PAGING:
|
||||
} else if (method.isPageQuery()) {
|
||||
return new PagedExecution(method.getParameters());
|
||||
case MODIFYING:
|
||||
} else if (method.isModifyingQuery()) {
|
||||
return method.getClearAutomatically() ? new ModifyingExecution(
|
||||
method, em) : new ModifyingExecution(method, null);
|
||||
default:
|
||||
} else {
|
||||
return new SingleEntityExecution();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class JpaQueryMethod extends QueryMethod {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
protected boolean isModifyingQuery() {
|
||||
public boolean isModifyingQuery() {
|
||||
|
||||
return null != method.getAnnotation(Modifying.class);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.springframework.data.jpa.repository.sample.UserRepository;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.core.support.DefaultRepositoryMetadata;
|
||||
import org.springframework.data.repository.query.QueryMethod;
|
||||
import org.springframework.data.repository.query.QueryMethod.Type;
|
||||
|
||||
|
||||
/**
|
||||
@@ -95,7 +94,7 @@ public class JpaQueryMethodUnitTests {
|
||||
new JpaQueryMethod(repositoryMethod, metadata, extractor);
|
||||
|
||||
assertEquals("User.findByLastname", method.getNamedQueryName());
|
||||
assertThat(method.getType(), is(Type.COLLECTION));
|
||||
assertThat(method.isCollectionQuery(), is(true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user