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> </configuration>
</plugin> </plugin>
<!-- Querydsl --> <!-- Querydsl and Specifications -->
<!-- <plugin> --> <plugin>
<!-- <groupId>com.mysema.maven</groupId> --> <groupId>com.mysema.maven</groupId>
<!-- <artifactId>apt-maven-plugin</artifactId> --> <artifactId>apt-maven-plugin</artifactId>
<!-- <version>1.1.3</version> --> <version>1.1.3</version>
<!-- <executions> --> <executions>
<!-- <execution> --> <execution>
<!-- <goals> --> <goals>
<!-- <goal>process</goal> --> <goal>process</goal>
<!-- </goals> --> </goals>
<!-- <configuration> --> <configuration>
<!-- <outputDirectory>target/generated-sources/java</outputDirectory> --> <outputDirectory>target/generated-sources/java</outputDirectory>
<!-- <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor> --> <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
<!-- </configuration> --> </configuration>
<!-- </execution> --> </execution>
<!-- </executions> --> </executions>
<!-- </plugin> --> </plugin>
</plugins> </plugins>

View File

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