diff --git a/pom.xml b/pom.xml index d5f876b66..953602dad 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 3.6.10.Final 1.8.0.10 2.0.0 - 2.2.1 + 2.3.0 1.8.0.BUILD-SNAPSHOT reuseReports diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java index 92edaefb2..663d04b4d 100644 --- a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2012 the original author or authors. + * Copyright 2008-2014 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. @@ -23,11 +23,11 @@ import java.util.Collection; import java.util.List; import javax.persistence.EntityManager; -import javax.persistence.Parameter; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.ParameterExpression; import javax.persistence.criteria.Root; import org.junit.Ignore; @@ -46,21 +46,6 @@ public class OpenJpaNamespaceUserRepositoryTests extends NamespaceUserRepository @PersistenceContext EntityManager em; - /** - * Ignored until https://issues.apache.org/jira/browse/OPENJPA-2018 gets fixed. - */ - @Override - @Ignore - public void findsAllByGivenIds() { - - } - - /** - * Ignored until https://issues.apache.org/jira/browse/OPENJPA-2018 gets fixed. - */ - @Override - public void handlesIterableOfIdsCorrectly() {} - @Test public void checkQueryValidationWithOpenJpa() { @@ -82,7 +67,7 @@ public class OpenJpaNamespaceUserRepositoryTests extends NamespaceUserRepository /** * Test case for https://issues.apache.org/jira/browse/OPENJPA-2018 */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({ "rawtypes" }) @Test @Ignore public void queryUsingIn() { @@ -93,22 +78,13 @@ public class OpenJpaNamespaceUserRepositoryTests extends NamespaceUserRepository CriteriaQuery criteriaQuery = builder.createQuery(User.class); Root root = criteriaQuery.from(User.class); - criteriaQuery.where(root. get("id").in(builder.parameter(Collection.class))); + ParameterExpression parameter = builder.parameter(Collection.class); + criteriaQuery.where(root. get("id").in(parameter)); TypedQuery query = em.createQuery(criteriaQuery); - for (Parameter parameter : query.getParameters()) { - query.setParameter(parameter, Arrays.asList(1, 2)); - } + query.setParameter(parameter, Arrays.asList(1, 2)); List resultList = query.getResultList(); assertThat(resultList.size(), is(2)); } - - /** - * Ignored until https://issues.apache.org/jira/browse/OPENJPA-2018 gets fixed. - */ - @Override - public void invokesQueryWithVarargsParametersCorrectly() { - - } } diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaParentRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaParentRepositoryIntegrationTests.java index 9f01411c2..6688e98b7 100644 --- a/src/test/java/org/springframework/data/jpa/repository/OpenJpaParentRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaParentRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -23,7 +23,5 @@ public class OpenJpaParentRepositoryIntegrationTests extends ParentRepositoryInt @Override @Ignore - public void testWithJoin() throws Exception { - - } + public void testWithJoin() throws Exception {} } diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java index 7458b4cb6..cef6e4455 100644 --- a/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2014 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. @@ -29,11 +29,5 @@ public class OpenJpaUserRepositoryFinderTests extends UserRepositoryFinderTests @Ignore @Override - public void findsByLastnameIgnoringCase() throws Exception { - } - - @Ignore - @Override - public void findsByLastnameIgnoringCaseLike() throws Exception { - } + public void findsByLastnameIgnoringCaseLike() throws Exception {} } diff --git a/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java index dc76fac4a..3990c6d13 100644 --- a/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -47,8 +47,7 @@ import org.springframework.transaction.annotation.Transactional; @ContextConfiguration("classpath:config/namespace-application-context.xml") public class ParentRepositoryIntegrationTests { - @Autowired - ParentRepository repository; + @Autowired ParentRepository repository; @Before public void setUp() { @@ -60,6 +59,9 @@ public class ParentRepositoryIntegrationTests { repository.flush(); } + /** + * @see DATAJPA-287 + */ @Test public void testWithoutJoin() throws Exception { @@ -80,15 +82,17 @@ public class ParentRepositoryIntegrationTests { assertThat(page.getTotalPages(), is(1)); } + /** + * @see DATAJPA-287 + */ @Test public void testWithJoin() throws Exception { Page page = repository.findAll(new Specification() { public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder cb) { - Path> childrenPath = root.get("children"); root.join("children"); // we are interesting in distinct items, especially when join presents in query query.distinct(true); - return cb.isNotEmpty(childrenPath); + return cb.isNotEmpty(root.> get("children")); } }, new PageRequest(0, 5, new Sort(Sort.Direction.ASC, "id")));