Commit Graph

353 Commits

Author SHA1 Message Date
Oliver Gierke
d4119dcdbe DATAJPA-379 - Prepare 1.4.0.RC1 release.
Upgraded to Spring Data Build parent 1.1.1.RELEASE. Upgraded to Spring Data Commons 1.6.0.RC1. Switched to milestone repository. Adapted documentation references to RC1 of SPring Data Commons. Updated changelog, notice and readme.
2013-08-01 18:07:32 +02:00
Thomas Darimont
22b1f6fa1b DATAJPA-344 - Explain about save strategy repositories in ref doc.
Added section "entity persistence" to the reference documentation explaining the supported strategies for the detection of new-entities.

Original pull request: #32.
2013-07-30 18:22:32 +02:00
Thomas Darimont
619c1e6a55 DATAJPA-107 - Add support to specify TemporalType for Date query parameters.
Introduced JpaParameters abstraction to support custom jpa-specific annotations on query parameters. Adjusted Parameter binders to use the JpaParameters abstraction. Added special handling for temporal JpaParameters to ParameterBinder.bind(…) and CriteriaQueryParameterBinder.bind(…).

Adapted changes introduced in DATACMNS-350. Original pull request: #31.
2013-07-30 15:09:07 +02:00
Thomas Darimont
fbb88e8c76 DATAJPA-346 - EclipseLink specific workaround for joins in QueryUtils.
Added fix in QueryUtils to work around an EclipseLinks specialty to add strict joins on a call to root.get(…) even if a later root.join(…, JoinType.LEFT) should trump this.

We needed the first call to examine the metamodel of the path obtained to decide whether to join at all in next steps. We now work around this issue by doing a lot of ugly type checking and casting on the Metamodel directly.

We filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=413892 to maybe let EclipseLink improve at that point.

Original pull request: #30.
2013-07-29 12:06:12 +02:00
Thomas Darimont
6824cc158e DATAJPA-269 - Add support for derived identifier of nested composite keys.
Extended JpaMetamodelEntityInformation to deal with entities with custom composite keys for which we have to derive the identifier. Introduced IdentifierDerivingDirectFieldAccessFallbackBeanWrapper that is capable of deriving identifier values. Added test case to verify the support for save / load of entities with custom composite keys.

Original pull request: #28.
2013-07-26 15:32:45 +02:00
Thomas Darimont
5e5f494ac5 DATAJPA-377 - Remove "order by"-part from generated count query.
Adjusted createCountQueryFor(…) in QueryUtils to leave out the order by part in the generated query. This avoids problems with databases that require columns specified in the order by clause to be in the select / group by list for count queries (e.g. H2). In addition to that this should give us a little performance boost if the database did not already optimize the query execution.

Original pull request: #29.
2013-07-25 21:31:30 +02:00
Oliver Gierke
153999d141 DATAJPA-376 - PersistentProperty now considers JPA @Transient.
JpaPersistentPropertyImpl is now considered persistent if it carries a @javax.persistence.Transient annotation. This should allow persistence providers to safely generate additional fields and not cause trouble in the mapping framework this way.
2013-07-25 10:34:21 +02:00
Thomas Darimont
34854d2f02 DATAJPA-370 - Added missing package-info.java files. 2013-07-24 10:05:53 +02:00
Oliver Gierke
295424feb2 DATAJPA-373 - Fixed potential NullPointerException in StringQuery. 2013-07-24 09:56:22 +02:00
Thomas Darimont
3fd4fd1abe DATAJPA-368 - Added documentation of SpEL expression in @Query(…).
Added appropriate sections to chapter 2. Fixed type in native query example.
Updated author information on the index page.

Original pull request: #26.
2013-07-17 16:02:42 +02:00
Thomas Darimont
528363e125 DATAJPA-170 - Add support for SpEL in query expressions.
Introduced ExpressionBasedStringQuery to support the SpEL expression template rendering. This allows manually defined queries in either @Query or Spring Data named queries to use SpEL and reference the #entityName. Changed SimpleJpaQuery to use ExpressionBasedStringQuery by default. Added test case for repositories with SpEL expression based query methods.

Original pull request: #25.
2013-07-17 10:38:13 +02:00
Thomas Darimont
f25032abfa DATAJPA-353 - Fixed mapping file locations detected by CPSPUPP to conform to the JPA spec.
Adjusted scanForMappingFileLocations(…) in ClasspathScanningPersistenceUnitPostProcessor to resolve the paths to class-path loadable paths. Updated test cases accordingly. Added test case and required resources to verify that mapping files with recursive wildcard pattern can be found from multiple locations in class path.

Original pull request: #24.
2013-07-16 17:33:11 +02:00
Oliver Gierke
4ff0671105 DATAJPA-148 - Remove qualification of sort reference for functions.
When applying Sort instances we now check for the presence of a ( which indicates a function to be executed.
2013-06-27 22:19:01 +02:00
Oliver Gierke
bed347d223 DATAJPA-363 - Improved implementation of SimpleJpaRepository.delete(ID id).
Remove the additional call to exists(…) in favor of a null check, we'd have to trigger anyway in the case of and exists success. This will avoid triggering an additional query.
2013-06-27 22:17:24 +02:00
Jose Luis Rodriguez Alonso
5ec2efa6bb DATAJPA-361 - Improve QueryDslJpaRepository.findAll(Predicate, Pageable).
The paginating ….findAll(…) of QueryDslJpaRepository now only executes the query if we really have items to fetch, i.e. if the page requested really exists.
2013-06-25 11:57:09 +02:00
Oliver Gierke
4dffef0943 DATAJPA-348 - Extending workaround for HHH-6951.
We're now using AnnotationUtils.findAnnotation(…) in case of Hibernate to improve workaround for HHH-6951. Added id type caching as the annotation lookup is potentially expensive.

Added integration tests for Hibernate and EclipseLink.
2013-06-20 14:14:06 +02:00
Oliver Gierke
ba74ee10ba DATAJPA-359 - Correctly apply lock config for findOne(…).
SImpleJpaRepository.findOne(…) now applies the lock configuration potentially set on a redeclared method of the repository interface.
2013-06-19 09:35:18 +02:00
Oliver Gierke
f2bcf91b18 DATAJPA-357 - JpaRepository.findAll(Iterable<ID>) now returns List.
JpaRepository now overrides CrudRepository.findAll(Iterable<ID> ids) to return a List instead of an utterable as SimpleJpaRepository returns a List anyway.
2013-06-13 13:55:39 +02:00
Oliver Gierke
62f2231ae2 DATAJPA-352 - Fixed too aggressive validation of count queries.
Count queries are now only validated if the query method is a paging one actually. Improved the exception text in case of a validation error to indicate which method caused it.
2013-06-10 12:04:08 +02:00
Oliver Gierke
e27bd55e36 DATAJPA-351 - Upgrade to snapshot dependencies after M1 release. 2013-06-10 12:02:35 +02:00
Spring Buildmaster
b581568d72 DATAJPA-351 - Prepare next development iteration. 2013-06-04 10:17:42 -07:00
Spring Buildmaster
1a294caa88 DATAJPA-351 - Release version 1.4.0.M1. 2013-06-04 10:17:38 -07:00
Oliver Gierke
f077409ea1 DATAJPA-351 - Prepare 1.4 M1 release.
Upgraded to Spring Data Build 1.1.0. Upgraded to Spring Data Commons 1.6 M1. Added milestone repository. Updated documentation references to the 1.6 M1 artifacts.
2013-06-04 18:57:22 +02:00
Oliver Gierke
29dc2cb8a0 DATAJPA-350 - Improve EntityManager usage for query validation.
SimpleJpaQuery now uses an explicitly created EntityManager instance to verify the manually defined query be able to close the instance explicitly. This will improve GCing the instance.
2013-06-03 13:40:47 +02:00
Oliver Gierke
820655a7c4 DATAJPA-345 - Allow @Lock and @QueryHints to be used as meta-annotations.
@Lock and @QueryHints can now be used as meta annotations to create custom annotations to e.g. reuse a dedicated set of query hints.
2013-05-16 13:24:21 +02:00
Oliver Gierke
f5f4b6b7ad DATAJPA-343 - Fixed count query projection for queries with subselects.
Switched from an accidentally greedy quantifier for the query variable pickup with a possessive one.
2013-05-08 09:51:42 +02:00
Oliver Gierke
d655862251 DATAJPA-342 - Corrected generated count projection from string queries.
The variable put into the count(…) clause of the generated query is now the original value except we find a DTO project or a count projection in the first place.
2013-05-07 14:01:25 +02:00
Oliver Gierke
31006e1866 DATAJPA-341 - Fixed regression introduced in advanced LIKE binding.
We now don't throw an exception anymore in case a normal LIKE binding is used in manually defined queries.
2013-05-04 11:46:18 +02:00
Oliver Gierke
617423797d DATAJPA-340 - Updated template.mf to generate and improved OSGi manifest.
Opened up the upper bound for Spring to be able to work with Spring 4. Expanded lower boundary of Slf4j dependency to 1.6.4 to let STS 3.x work with the JAR out of the box.
2013-05-03 13:48:39 +02:00
Cristian Sandiga
e2c60ec6f0 DATAJPA-334 - Fixed referenced JUnit runner in readme.md.
SpringJUnit4TestRunner -> SpringJunit4ClassRunner.
2013-04-29 14:53:22 +02:00
Oliver Gierke
fc4f0c3410 DATAJPA-323 - Added integration tests for JavaConfig and Repositories. 2013-04-26 10:27:33 +02:00
Oliver Gierke
f697b2e102 DATAJPA-296 - Fixed ignore case handling for Querydsl integration.
When using QuerydslPredicateExecutor the ignore case flag defined on the given Order inside a Pageable is considered correctly.
2013-04-25 10:54:26 +02:00
Oliver Gierke
ace028fa2b DATAJPA-330 - Improve setup of persistence exception translation.
Removed the declaration of a global PersistenceExceptionTranslationPostProcessor as the factory already applies one at the bean level selectively. Added integration tests to make sure the translation gets applied and plain @Repository classes not affected at all.
2013-04-24 11:07:58 +02:00
Oliver Gierke
edddb6dfb5 DATAJPA-332 - Optimization for SimpleJpaRepository.findAll(…) taking Iterable.
We now shortcut the execution of SimpleJpaRepository.findAll(Iterable<Integer> ids) to return an empty collection in case no ids or null are given. Previously building a query with an IN clause failed with an empty parameter list given.
2013-04-19 10:51:04 +02:00
Oliver Gierke
4b1cd49079 DATAJPA-331 - Use correct snapshot repository to resolve plugin dependencies. 2013-04-19 10:36:57 +02:00
Oliver Gierke
391a77d058 DATAJPA-331 - Use lib-snapshot repository instead of libs-snapshot.
libs-snapshot filters repository declarations pointing into Artifactory again. This results in the plugin repository declaration in the Spring Data Build parent pom being stripped and the build to fail in case Bundlor is not already in the local repository.
2013-04-18 12:02:39 +02:00
Oliver Gierke
4c65ad1df6 DATAJPA-296 - Fixed application of ignore case flag on string queries.
The ignore-case flag held in a Sort.Order is now also applied when manually defining queries.
2013-04-18 11:20:14 +02:00
Oliver Gierke
0bf2cb391e DATAJPA-231 - Added support for derived countBy queries.
PartTreeJpaQuery evaluates the newly introduced PartTree.isCountProjection() to rather trigger a derived count query instead of the actual query. Extended Query execution to potentially massage the returned value into the return type of the query method to allow long and int as return types for count queries.
2013-03-26 15:21:26 +01:00
Oliver Gierke
d364b441b4 DATAJPA-319 - Use default CDI repository scope (application).
Don't inherit the scope of the repository from the EntityManager but let it be the default (application scope singleton).
2013-03-25 17:53:52 +01:00
Oliver Gierke
40caa97808 DATAJPA-321, DATAJPA-320 - Upgraded to Querydsl 3.0.0.
Upgraded to Spring Data Build 1.1.0.BUILD-SNAPSHOT to benefit from Querydsl dependency upgrade. Upgraded Maven APT plugin to 1.0.8 alongside.
2013-03-25 17:53:52 +01:00
Oliver Gierke
f6863e6972 DATAJPA-119 - JpaMetamodelEntityInformation now considers @Version.
If a JPA entity class has an @Version attribute we now consider this to determine whether it is new or not. So even if an id is set we'll consider it new as long as the version attribute is null.
2013-03-25 17:53:52 +01:00
Oliver Gierke
9dcf919207 DATAJPA-303 - Added integration test to show auditing on update working. 2013-03-25 17:53:52 +01:00
Oliver Gierke
08831c1f60 DATAJPA-317 - Added @NoRepositoryBean to JpaRepsitory interface.
This prevents the repository from being considered a repository a Spring bean instance has to be created for in case it is accidentally picked up during component scanning.
2013-03-25 17:53:30 +01:00
Oliver Gierke
d0a383a2d9 DATAJPA-316 - Added build profiles to build against Hibernate 4.1 and 4.2.
Upgraded to Spring Data Build 1.0.2.RELEASE along the way. Needed to upgrade to HSQLDB 2.2.9 as Hibernate 4 doesn't work with HSQLDB versions 1.x. Set up OpenJPA test run to still use HSQLD 1.8.0.10 as OpenJPA does not work with HSQLDB 2.x. *sigh*
2013-03-19 14:41:39 +01:00
Oliver Gierke
3d3fbbc0e8 DATAJPA-314 - Improve namespace XSDs to avoid IDE warnings.
Removed the explicit pointer to the XSD location of the context namespace as this apparently seems to cause duplicate imports of the tool namespace XSD.
2013-03-18 19:14:06 +01:00
Oliver Gierke
285a994e95 DATAJPA-292 - Manually defined queries can contain like expressions now.
This commit introduces support for JPQL inline like expressions such as "… like ?1%". The implementation will detect those expressions and turn the query back into a valid JPQL one. On query execution the parameters will be bound according to the like expression defined in the query.
2013-03-13 17:16:53 +01:00
Oliver Gierke
c2aa1215f8 DATAJPA-308 - Improved test case to satisfy Java 6 compiler.
Added explicit type hints to matchers as the code won't compile under JDK 6 otherwise.
2013-03-08 11:54:03 +01:00
Oliver Gierke
bc0bf33b55 Fixed indentation to tabs in pom.xml. 2013-03-07 13:15:31 +01:00
Oliver Gierke
8dec595a19 DATAJPA-308 - Improve registration of PersistenceAnnotationBeanPostProcessor. 2013-03-07 12:59:06 +01:00
Kevin Raymond
60923c8651 DATAJPA-296 - Added support for case insensitive sorting.
Modified QueryUtils.toJpaOrder(…) to apply lower criteria if ignore case on Order is set to true and the property being sorted is of type String. Upgraded to Spring Data Commons 1.6.0.BUILD-SNAPSHOT along the way.
2013-02-27 18:47:43 +01:00