DATACMNS-62 - Adapt changes in Spring Data Commons.

This commit is contained in:
Oliver Gierke
2011-08-21 12:18:37 +02:00
parent 480901a4ba
commit 160b738a4d
3 changed files with 6 additions and 9 deletions

View File

@@ -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();
}
}

View File

@@ -76,7 +76,7 @@ public class JpaQueryMethod extends QueryMethod {
* @return
*/
@Override
protected boolean isModifyingQuery() {
public boolean isModifyingQuery() {
return null != method.getAnnotation(Modifying.class);
}

View File

@@ -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));
}