making the userspecification immutable and re-enabling a problematic plugin

This commit is contained in:
eugenp 2015-01-28 12:12:51 +02:00
parent f479bc8a21
commit 300ff44b46
2 changed files with 18 additions and 26 deletions

View File

@ -327,24 +327,24 @@
</configuration>
</plugin>
<!-- Querydsl -->
<!-- Querydsl and Specifications -->
<!-- <plugin> -->
<!-- <groupId>com.mysema.maven</groupId> -->
<!-- <artifactId>apt-maven-plugin</artifactId> -->
<!-- <version>1.1.3</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <goals> -->
<!-- <goal>process</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <outputDirectory>target/generated-sources/java</outputDirectory> -->
<!-- <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

View File

@ -11,11 +11,7 @@ import org.springframework.data.jpa.domain.Specification;
public class UserSpecification implements Specification<User> {
private SearchCriteria criteria;
public UserSpecification() {
}
private final SearchCriteria criteria;
public UserSpecification(final SearchCriteria criteria) {
super();
@ -26,10 +22,6 @@ public class UserSpecification implements Specification<User> {
return criteria;
}
public void setCriteria(final SearchCriteria criteria) {
this.criteria = criteria;
}
@Override
public Predicate toPredicate(final Root<User> root, final CriteriaQuery<?> query, final CriteriaBuilder builder) {
if (criteria.getOperation().equalsIgnoreCase(">")) {