Commit Graph

215 Commits

Author SHA1 Message Date
Oliver Gierke
9bf6703c63 DATADOC-99 - ParameterExpressionProvider now uses parameter type instead of handed in type if assignable.
JpaQueryCreator hands Comparable into ParameterExpressionProvider to create ParameterExpression instances for Comparables. The ParameterExpressionProvider in turn now inspects the actual Parameter type and hand this one into the builder in case it's assignable (read: more concrete) to the given type requested.
2011-09-06 11:49:07 +02:00
Oliver Gierke
ab5aad51d5 DATAJPA-101 - Prepare 1.1.x development line. 2011-09-05 14:34:16 +02:00
Oliver Gierke
4976684e96 DATAJPA-101 - Prepare release of 1.1.0.M1. 2011-09-05 14:20:51 +02:00
Oliver Gierke
0b737586c8 Reference documentation formatting of XMLEditor. 2011-09-05 13:12:29 +02:00
Oliver Gierke
c6045de7ad DATAJPA-80, DATAJPA-91 - Updated reference documentation.
Mention PersistenceExceptionTranslator being activated when using the JPA namespace. Documented custom namespace attributes special to the JPA namespace.
2011-09-05 13:12:14 +02:00
Oliver Gierke
ca52ec29be DATAJPA-81 - SimpleJpaRepository.exists(…) now projects to the id to prevent the entire object being read and mapped. 2011-09-05 08:31:32 +02:00
Oliver Gierke
04349d25dc DATAJPA-86 - Pagination over queries using group-by works correctly.
Added handling of count methods for queries using group by. In case the count query returns multiple results we use the number of results instead of failing. If the result contains one result we use this one.

Moved hint handling to AbstractJpaQuery.
2011-09-04 16:56:50 +02:00
Oliver Gierke
170d31707c DATAJPA-96 - JpaQueryCreator now correctly resolves nested properties for all supported keywords.
Removed Part.toDotPath() references to create Expressions as they have to be atomic.
2011-09-04 14:56:39 +02:00
Oliver Gierke
7516816adb DATADOC-93 - Don't catch IllegalArgumentExceptions raised by missing domain class in JPA Metamodel.
We now don't catch an IllegalArgumentException being thrown in case a domain class is not found in the metamodel. If it occurs there's nothing we can do about it as we can't come up with an EntityInformation instance then and the persistence provider couldn't handle it anyway.
2011-09-04 14:25:27 +02:00
Oliver Gierke
b291a5f5f9 DATAJPA-98 - Formatted sources with Spring Data Eclipse formatting settings. 2011-09-02 18:11:10 +02:00
Phillip Webb
27ad91fbbc DATAJPA-92 - JpaQueryCreator now inspects enum to decide how to handle ignore case scenarios. 2011-08-29 18:06:30 +02:00
Phillip Webb
aa6a7c1983 DATAJPA-94 - Repository queries consider Sort instance in a Pageable again. 2011-08-29 11:31:47 +02:00
Phil Webb
5b9e959b3e DATAJPA-92 - Added support for IgnoreCase keyword.
The query creation subsystem now supports using IgnoreCase when referencing String parameters, e.g.:

  findByUsernameIgnoreCase(String username);

Both 'IgnoreCase' and 'IgnoringCase' are supported. If you'd like to entirely ignore cases for all String property references add 'AllIgnoreCase' or 'AllIgnoringCase' to the query method.
2011-08-25 12:52:14 +02:00
Oliver Gierke
b6b386893e DATADOC-90 - Fixed potential concurrency problem for PartTree based query creation.
We now eagerly create CriteriaQuery and it's ParameterExpressions in QueryPreparer's constructor. Lazily doing so could let to exceptions accessing the ParameterExpressions in race conditions.
2011-08-23 09:04:20 +02:00
Oliver Gierke
0144be5b16 DATADOC-90 - Refactored PartTreeJpaQuery to create new JpaQueryCreator on every query recreation.
JpaQueryCreator is stateful as we create a list of ParameterExpressions and iterate over them. So we have to re-instantiate the JpaQueryCreator to not create an exception on the second attempt.
2011-08-21 14:33:55 +02:00
Oliver Gierke
160b738a4d DATACMNS-62 - Adapt changes in Spring Data Commons. 2011-08-21 14:33:00 +02:00
Phil Webb
480901a4ba DATAJPA-88 - Minor improvements to documentation. 2011-08-16 17:40:58 +02:00
Oliver Gierke
9c802c207c Prepare 1.1.0 development. 2011-07-21 20:52:25 +02:00
Oliver Gierke
c2e3984545 Prepare 1.0.0.RELEASE. 2011-07-21 20:28:41 +02:00
Oliver Gierke
00ece2c25e Polished codebase and added architecture management.
Added Sonargraph architecture description. Removed cyclic package dependency. Introduced JpaEntityInformationSupport to contain common getEntityName() method and serving as factory for JpaEntityInformation instances.
2011-07-21 12:20:18 +02:00
Oliver Gierke
14e8bd6955 Added package-info.java for support package. 2011-07-21 10:28:14 +02:00
Oliver Gierke
7eed88de16 Updated changelog for 1.0 release. 2011-07-21 10:06:57 +02:00
Oliver Gierke
d0b7901ce8 DATAJPA-78 - Upgrade to Querydsl 2.2.0.
Upgraded to Querydsl 2.2.0. Added configuration to generate query classes for AbstractPersistable and AbstractAuditable. Package those query classes into the source JAR and compile it into the binary as well. Upgraded Mysema APT plugin to 1.0.2.
2011-07-19 17:25:47 +02:00
Oliver Gierke
537ac8c23c DATAJPA-77 - Count queries for manually defined queries don't get pagination applied anymore. 2011-07-19 09:22:02 +02:00
Oliver Gierke
c164ac3f20 DATAJPA-71 - CriteriaQueries created from derived queries are cached now if possible.
We now create the CriteriaQuery instance for derived queries only once in case the query method does not contain a dynamic sort parameter (either through a plain Sort or via a Pageable).
2011-07-19 09:04:39 +02:00
Oliver Gierke
829ddfce01 DATACMNS-49 - Fixed query syntax in test named query file. 2011-06-23 20:18:53 +02:00
Oliver Gierke
5d3602d53f DATACMNS-49 - Added integration for Spring Data named queries.
We now support extracting query definitions into a properties file which can be configured on the JpaRepositoryFactoryBean. The namespace will look for classpath*:META-INF/jpa-named-queries.properties by default.
2011-06-23 19:47:59 +02:00
Oliver Gierke
3f968c861f Prepare next development iteration. 2011-06-23 10:31:57 +02:00
Oliver Gierke
1d79c1bfeb Prepare 1.0.0.RC1 release.
Updated changelog and Spring Data Commons version to 1.1.0.M2.
2011-06-23 10:21:39 +02:00
Oliver Gierke
405fccb04f DATAJPA-64 - Refactored query execution to use ParameterExpression.
The JpaQueryCreator now creates a CriteriaQuery using ParameterExpressions that have to be bound later on. Refactored the RepositoryQuery implementation hierarchy and JpaQueryExecution as binding has to be done by the query classes now. This required the introduction of a special CriteraQueryParameterBinder as well. It uses the ParameterExpressions of the CriteriaQuery to bind the actual query values later on.

We have to convert arrays passed into query method into collections as none of the major persistence providers support binding arrays to IN parameters currently.
2011-06-21 20:49:54 +02:00
Oliver Gierke
762e57ca2f DATAJPA-31 - Changed default of @Modifying(clearAutomatically) to false. 2011-06-19 18:47:29 +02:00
Oliver Gierke
53c3cf9230 DATAJPA-38 - Introduced MergingPersistenceUnitManager. 2011-06-13 20:28:50 -07:00
Oliver Gierke
bafe2ee64e Reduced log level for testing. 2011-06-13 20:28:23 -07:00
Oliver Gierke
ea0ff71499 Adapted package refactorings in Spring Data Commons.
Resolved package dependencies as well.
2011-06-13 20:28:23 -07:00
Oliver Gierke
868f3ec5a6 Polished documentation creation. 2011-06-13 17:29:09 -07:00
Oliver Gierke
9023b2e3da DATAJPA-43 - Updated documentation to reflect correct use of JpaSpecificationExecuter. 2011-06-13 17:28:54 -07:00
Oliver Gierke
12706a6c5b DATAJPA-56 - Cover In and NotIn query keywords in reference documentation. 2011-06-13 16:41:14 -07:00
Oliver Gierke
b8ad5e8b81 DATAJPA-68 - Refactored AuditingEntityListener.
Separated touch(…) methods for updating and creation as some persistence providers might hand in entities with IDs already assigned into a @PrePersist method and thus the isNew() check will fail.
2011-06-13 16:24:10 -07:00
Oliver Gierke
356ce6330c Moved QueryDslPredicateExecutor into Spring Data Commons. 2011-05-23 12:23:52 +02:00
Oliver Gierke
75281a99d4 DATACMNS-29 - Adapted changes in Spring Data Commons. 2011-05-12 14:01:56 +02:00
Oliver Gierke
159ea28f88 DATACMNS-36 - Revert to using @Transactional at repository implementation again. 2011-05-12 13:59:53 +02:00
Oliver Gierke
ad40b37f40 DATACMNS-35 - Added implementation and test for newly introduced Repository.delete(ID id) method. 2011-05-11 18:39:27 +02:00
Oliver Gierke
30bb367e96 DATAJPA-59, DATAJPA-60 - Improved handling of PersistenceProviders not capable of extracting queries for paging query methods.
Removed check for that capability (QueryExtractor.canExtractQuery()) from JpaQueryMethod and defer it into NamedQuery as we can handle derived queries and queries annotated with @Query regardless of that capability.

Made exception message a bit more verbose to give hints what to do if the exception occurs.
2011-05-11 13:33:35 +02:00
Oliver Gierke
9add191da5 Updated changelog. 2011-05-10 12:48:12 +02:00
Oliver Gierke
536f8ccd91 DATAJPA-58 - JpaPersistableEntityInformation now uses Persistable.isNew(…).
Added unit tests to verify behavior and updated changelog accordingly.
2011-05-10 12:20:29 +02:00
Oliver Gierke
1cfa3acb22 Updated changelog. 2011-04-28 08:09:17 +02:00
Oliver Gierke
e81d480021 Prefer method.getAnnotation(…) over AnnotationUtils.findAnnotation(…).
The latter method is much much slower than the former and JpaQueryMethod.isModifyingQuery() is invoked for every query method execution.
2011-04-28 07:53:33 +02:00
Oliver Gierke
33a3c8f5ae DATACMNS-33 - Adapted API changes for Repository.count().
Also changed return types for count() methods on JpaSpecificationExecutore and QueryDslPredicateExecutor.
2011-04-21 10:02:10 +02:00
Oliver Gierke
97859f5dee DATACMNS-32 - Removed Querydsl support classes and use the ones from Spring Data Commons Core. 2011-04-20 20:32:21 +02:00
Oliver Gierke
c4a71140c9 DATAJPA-48 - Added findAll(Specification, Sort) to JpaSpecificationExecutor.
Added implementation to SimpleJpaRepository.
2011-04-11 15:15:51 +02:00