Commit Graph

430 Commits

Author SHA1 Message Date
Thomas Darimont
3c30ba2bba DATAJPA-469 - Prepare 1.5.0.RELEASE.
Updated change log, readme, notice. Updated links in index.xml to point to SD Commons documentation.

Original pull request: #60.
2014-02-24 15:04:24 +01:00
Christoph Strobl
7e2d7831a4 DATAJPA-470 - Update Documentation.
Update urls to point to spring.io. Added missing id tag to documentation sections. Fix some typos in reference manual. Update readme.md to use consistent set of database and dialect. Add missing end tag for 'para' in FAQ section. Update authors for proper rendering in PDF. Added productname tag. Added links to Stack Overflow.

Original pull request: #59.
2014-02-24 11:57:19 +01:00
Oliver Gierke
59d4e80010 DATAJPA-474 - Fixed documentation on CDI setup of EntityManagers.
Previously, the reference documentation was missing details of how to set up EntityManager instances for usage of Spring Data JPA repositories in a CDI context. Augmented the section on complete manual setup but also added an example of the necessary setup in a pure JavaEE context.
2014-02-23 16:12:10 +01:00
Oliver Gierke
10dd37a619 DATAJPA-473 - Fixed bug in binding detection in String queries.
Query parameter binding replacements were undone if a simple binding was contained in the query. Fixed that and also make sure we don't create superfluous multiple bindings for the same variable and binding type.
2014-02-23 14:11:06 +01:00
Oliver Gierke
992ccb5956 DATAJPA-471 - Ensure test succeed on Spring 4.
Annotated MappedTypeRepository test repository interface with @NoRepositoryBean to prevent it to fail the build on Spring 4.
2014-02-20 20:27:46 +01:00
Oliver Gierke
246eb989fc DATAJPA-469 - Upgraded to Spring Data Commons snapshots. 2014-02-19 20:08:58 +01:00
Marten Deinum
cba12aa148 DATAJPA-462 - Updated FAQ on how to integrate Spring Data JPA with an existing Hibernate data access layer. 2014-02-19 14:59:31 +01:00
Oliver Gierke
c0c1209130 DATAJPA-461 - Improve binding detection.
Improved the regular expression to detect binding detection to safely find as-is bindings.
2014-02-11 18:14:31 +01:00
Oliver Gierke
1d4b57f684 DATAJPA-461 - Polishing of binding implementation for StringQueries.
We now always create a ParameterBinding for all parameters to simplify the client code so that it can safely always lookup bindings and apply them.

Changed the setup of the regular expression to work with the keywords provided by the binding types to ease future extensions.

Added integration test to quickly verify the EclipseLink bug we're running into now for further reference.

Original pull request: #56.
2014-02-11 15:32:39 +01:00
Thomas Darimont
f8b0917c90 DATAJPA-461 - Fixed regression in parameter binding of arrays.
Enhanced binding of parameters in StringQueryParameterBinder to be able to deal with situations where a parameter value has to be converted to be correctly bound e.g. for parameter values in IN-expressions.

We now only convert array values to collections if the value is to be bound in the context of an IN-parameter. Previously we erroneously always converted an array value to a collection value which lead to problems if an array value was meant to be used "as-is" e.g. in cases where an user wants to query for a certain byte[].

Original pull request: #56.
2014-02-11 15:32:22 +01:00
Oliver Gierke
c85caf00d4 DATAJPA-458 - Added aop.xml to be used within Eclipse. 2014-02-06 19:21:26 +01:00
Oliver Gierke
112d76ac9d DATAJPA-459 - Suppress verbose output for Querydsl APT generation. 2014-02-06 19:21:07 +01:00
Oliver Gierke
75d6f26572 DATAJPA-454 - Fixed join creation in QueryUtils.
QueryUtils now only creates a join for collection properties that are explicitly annotated with an @ManyTo… annotation. This allows collection like properties like byte[] be referred to as non-collection property and thus not trigger a join when a derived query is created.
2014-02-06 19:19:27 +01:00
Spring Buildmaster
869be7eafc DATAJPA-450 - Prepare next development iteration. 2014-01-29 04:43:57 -08:00
Spring Buildmaster
d5e166b469 DATAJPA-450 - Release version 1.5.0.RC1. 2014-01-29 04:43:55 -08:00
Oliver Gierke
c6f486eee2 DATAJPA-450 - Prepare 1.5.0.RC1 release.
Upgraded to Spring Data build parent 1.3 RC1 and Spring Data Commons 1.7 RC1. Updated changelog and references from reference documentation. Switched to milestone repository.
2014-01-28 13:36:23 +01:00
Oliver Gierke
7b9b303f05 DATAJPA-453, DATAJPA-435 - Fixed BeanFactoryPostProcessor handling of BeanFactory hierarchies.
The AuditingBeanFactoryPostProcessor and EntityManagerBeanDefinitionPostProcessor now correctly lookup BeanDefinitions within BeanFactory hierarchies. Also, the EMBDPP registers the EntityManager bean definition in the BeanFactory, the source BeanDefinition for the EntityManagerFactory is found.
2014-01-27 12:41:57 +01:00
Oliver Gierke
7b5425322b DATAJPA-445 - Enable constructor injection for EntityManagers.
Enabling repositories now registers a BeanFactoryPostProcessor that will register a SharedEntityManagerCreator BeanDefinition for all EntityManagerFactory definitions available in the ApplicationContext.

We register the bean name of the EMF as qualifier for the BeanDefinition for the EntityManager to allow an explicit reference in multi-EMF scenarios.

Renamed default persistence unit to spring-data-jpa.
2014-01-25 23:55:37 +01:00
Oliver Gierke
655ad131d2 DATAJPA-444 - Prefer Hibernate 4.3 provider interface over legacy one.
Accessing the legacy persistence provider class in Hibernate 4.3 causes a warning being logged. As we generally want to detect the presence of Hibernate in general only, we now check for the Hibernate 4.3 persistence provider interface first to immediately find the new interface and thus avoid the warning.

Upgraded to Hibernate 4.3.1.
2014-01-24 17:12:44 +01:00
Oliver Gierke
cae3ce4532 DATAJPA-450 - Removed Spring dependency versions.
Added plugin repository and changed to libs-snapshot to correctly lookup Bundlor and other project dependencies.
2014-01-20 13:02:48 +01:00
Oliver Gierke
b1585377c2 DATACMNS-420 - Adapted test cases due to latest changes in Spring Data Commons. 2014-01-18 12:36:16 +01:00
Oliver Gierke
9640ea81ad DATAJPA-417 - Upgraded to EclipseLink 2.5.1.
Was able to upgrade to EclipseLink 2.5.1 and re-enable a previously ignored integration tests. However, some of the disabled test cases still fail despite the relevant bug being reported as fixed in 2.5.1.

Turned the workaround in QueryUtils into a TODO for removal as we don't want to strongly force EclipseLink users to upgrade to 2.5.x yet.
2014-01-17 17:12:20 +01:00
Oliver Gierke
d442bb5fa0 DATAJPA-448 - Added contribution guidelines.
Linked to the actual contribution guidelines maintained in the Spring Data Build project.
2014-01-14 13:41:13 +01:00
Oliver Gierke
f2bc6fc466 DATAJPA-442 - Enable CDI repositories to be instantiated eagerly.
From the CDI extension we now use the callback newly introduced in Spring Data Commons to enable it to trigger eager initialization.

See also: DATACMNS-416.
2014-01-13 12:04:14 +01:00
Oliver Gierke
8a4c04a524 DATAJPA-446 - Removed generic types from AuditingEntityListener. 2014-01-12 19:25:42 +01:00
Oliver Gierke
3f4eecf97e DATAJPA-443 - Upgraded to Hibernate 4.2.8 and 4.3.0. 2014-01-12 19:25:42 +01:00
Oliver Gierke
516977f722 DATAJPA-428 - Upgraded to snapshot of Spring Data build parent. 2014-01-12 19:25:42 +01:00
Thomas Darimont
5e8928f54f DATAJPA-444 - Improve detection of PersistenceProvider implementations.
Since the location of the Hibernate EntityManager implementation changed in Hibernate 4.3 to org.hibernate.jpa.HibernateEntityManager, we now support org.hibernate.jpa.HibernateEntityManager as well as  org.hibernate.ejb.HibernateEntityManager as a Hibernate PersistenceProvider.

Original pull request: #55.
2014-01-08 16:36:08 +01:00
Oliver Gierke
44994ff3e9 DATAJPA-435 - Let Sonar reuse existing test reports. 2013-12-11 13:21:54 +01:00
Thomas Darimont
429538fba8 DATAJPA-410 - Improved documentation on jpa:repository namespace.
We now mention that we require a bean with name transactionManager to be present if no transaction-manager-ref is defined.

Original pull request: #47.
2013-12-11 00:51:09 +01:00
Komi Serge Innocent
a0a98dfc57 DATAJPA-420 - Fixed count projection for manual queries with projections.
Original pull request: #52.
2013-12-10 23:13:56 +01:00
Oliver Gierke
ae10332b18 DATAJPA-430 - Tweaks to be compatible with Hibernate 4.3.
Latest Hibernate 4.3 releases have changes some behavior and internals slightly. Adapted the test cases accordingly and added another guard in JpaMetamodelEntityInformation to adhere to the new behavior.

Added build profile to be able to build against Hibernate 4.3.
2013-12-09 14:44:13 +01:00
Oliver Gierke
5d6e44d379 DATAJPA-12 - Simplified build setup for meta-model creation.
Consolidated the generation of the static meta-model for test classes into the Querydsl APT plugin.
2013-12-08 19:30:54 +01:00
Oliver Gierke
1d6806b979 DATAJPA-12 - Design changes in JpaSort.
Decided to go with a simpler way of building up attribute paths on JpaSort to avoid the need to work with JPA Path instances (and thus the EntityManager) entirely. Added shortcut constructors to JpaSort that take a vararg of Attribute or PluralAttribute respectively.

Interestingly, the test cases still have to be integration tests as the  fields in the statically generated meta-model are null until the EntityManagerFactory bootstrap process enhances them to contain actual values. So no real unit tests unfortunately.

Consolidated tests cases for MailMessageRepository into one class, especially to avoid the configuration QueryDslRepositorySupportIntegrationTests to interfere with the newly added tests. Also rather use SampleConfig configuration class to allow the test framework's caching mechanism to kick in.

Original pull request: #54.
2013-12-07 13:10:29 +01:00
Thomas Darimont
692b2382bf DATAJPA-12 - Added Sort implementations for JPA meta-model API and Querydsl.
Introduced JpaSort for sorting by JPA meta-model attribute paths. Introduced JpaMetaModelPathBuilder that can be used to ease the construction of Jpa meta-model attribute paths by the provided static factory method. Added new testing scenario (MailMessage and MailSender) to avoid to mess up the existing sample classes. Enabled static JPA meta-model generation in pom.xml.

Enhanced Querydsl to generate appropriate left joins when sorting by nested (singular) association properties. Converted XML configuration for QueryDslRepositorySupportIntegrationTests into JavaConfig.

Original pull request: #54.
2013-12-07 13:09:31 +01:00
Thomas Darimont
e51add8c76 DATAJPA-427 - Generate left joins for referenced associations in sort expressions.
Previously sorting by property of an associated object generated an inner join instead of a left join with QueryDsl and Hibernate. That excluded records that had null values on their join columns. We now generate appropriate left joins if we detect associations in the sort property expression.

Ignored test cases for EclipseLink since eclipse link generates an inner-join instead of an outer-join to fetch  associations in order by. Filed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422450

Original pull request: #53.
2013-12-04 13:59:07 +01:00
Spring Buildmaster
32f90661e0 DATAJPA-428 - Prepare next development iteration. 2013-11-19 04:29:39 -08:00
Spring Buildmaster
4df4d3eecb DATAJPA-428 - Release version 1.5.0.M1. 2013-11-19 04:29:37 -08:00
Oliver Gierke
8aafc4fb6c DATAJPA-428 - Prepare release 1.5.0.M1.
Upgraded to Spring Data Commons 1.7.0.M1 and Spring Data Build 1.3.0.M1. Use milestone repository instead of snapshot repo. Let reference documentation refer to 1.7 M1 reference in Spring Data Commons. Updated changelog, notice and readme.
2013-11-19 13:21:43 +01:00
Oliver Gierke
0d089a3d61 DATAJPA-426 - Improve extensibility of SimpleJpaRepository.
Made a few originally private method protected to allow usage from sub-classes.
2013-11-14 10:21:58 +00:00
Oliver Gierke
240ace24f3 DATAJPA-265 - Further polishing.
Original pull request: #50.
2013-11-12 12:04:20 +01:00
Oliver Gierke
80e1777a5b DATAJPA-265 - Improve implementation of AuditingBeanFactoryPostProcessor.
Polished the implementation of AuditingBeanFactoryPostProcessor to selectively add depends-on clauses to all bean definitions that will result in EntityManagerFactory instances eventually. Added unit tests to verify intended behavior for Java based configuration. Polished newly integrated test cases.

Removed obsolete code from AuditingEntityListener. Added configuration sample snippet. Polished reference documentation.

Original pull request: #50.
2013-11-11 20:43:07 +01:00
Thomas Darimont
44806cb7f1 DATAJPA-265 - Support for auditing configuration via JavaConfig.
Introduces the necessary infrastructure to configure auditing with JPA via JavaConfig using @EnableJpaAuditing.

Original pull request: #50.
2013-11-11 20:20:05 +01:00
Thomas Darimont
23e27f3332 DATAJPA-424 - Fixed alias detection in manually defined queries using SpEL.
ExpressionBasedStringQuery now resolves and evaluates SpEL expressions of the actual query in the constructor and passes the resolved query to the StringQuery constructor. This enables the alias detection mechanism to work properly.

Original pull request: #51
2013-11-07 13:50:46 +01:00
Oliver Gierke
9a279f83cf DATAJPA-419 - Adapt to new non-lazy-instantiation model of repositories.
Mostly mayor cleanups the way test cases bootstrap the repositories as they're now instantiated eagerly.
2013-11-05 16:41:48 +01:00
Oliver Gierke
e3b0148383 DATAJPA-405 - Guard against null predicates on query creation.
We now only call CriteriaQuery.where(…) if the predicate we handle is a non-null value. Adapted Jpa(Count)QueryCreator accordingly.
2013-10-27 17:41:50 +01:00
Oliver Gierke
d4d352584d DATAJPA-481 - Upgraded to Spring Framework 3.2.4.
Upgraded to Spring Data Build 1.3.0.BUILD-SNAPSHOT to benefit from upgrade to Spring Framework 3.2.4.

Made the sample mapping file in test folder a valid XML document to prevent Eclipse from marking it as error.
2013-10-27 17:41:50 +01:00
Oliver Gierke
5be0897d08 DATAJPA-481 - Upgraded to Spring Framework 3.2.4.
Upgraded to Spring Data Build 1.3.0.BUILD-SNAPSHOT to benefit from upgrade to Spring Framework 3.2.4.
2013-10-25 19:43:06 +02:00
Oliver Gierke
33216534be DATAJPA-415 - Polishing.
Simplified implementation of ParameterBinder.convertToCollectionIfNecessary(…).

Added a simpler test case for plain query execution and ignored that for EclipseLink and OpenJpa as it fails with both the EclipseLink and OpenJpa versions we currently rely on. See the ignored test cases for links to bug reports.

Original pull request: #45.
2013-10-22 16:42:11 +02:00
Thomas Darimont
2636f59304 DATAJPA-415 - Convert array parameter values to Collection if necessary.
In order to support query methods with array-typed parameters (e.g. parameters passed in as varargs) correctly we have to convert such an array into a collection. Previously we passed those parameters as is which led to Exceptions in EclipseLink and Hibernate, e.g. Hibernate: IllegalArgumentException: Encountered array-valued parameter binding, but was expecting [java.lang.Integer].
2013-10-22 14:35:03 +02:00