@ -24,4 +24,4 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
@@ -24,4 +24,4 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/].
This Code of Conduct is adapted from the https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at https://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/].
= Spring Data JPA image:https://travis-ci.org/spring-projects/spring-data-jpa.svg?branch=master[Build Status,link=https://travis-ci.org/spring-projects/spring-data-jpa] image:https://build.spring.io/plugins/servlet/buildStatusImage//SPRINGDATAJPA-DATAJPA[Build status,link=https://build.spring.io/browse//SPRINGDATAJPA-DATAJPA]
The primary goal of the http://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use data access technologies. This module deals with enhanced support for JPA based data access layers.
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use data access technologies. This module deals with enhanced support for JPA based data access layers.
== Features
@ -21,12 +21,12 @@ The primary goal of the http://projects.spring.io/spring-data[Spring Data] proje
@@ -21,12 +21,12 @@ The primary goal of the http://projects.spring.io/spring-data[Spring Data] proje
== Getting Help
This README as well as the http://docs.spring.io/spring-data/data-jpa/docs/current/reference/html[reference documentation] are the best places to start learning about Spring Data JPA. There are also https://github.com/spring-projects/spring-data-examples[two sample applications] available to look at.
This README as well as the https://docs.spring.io/spring-data/data-jpa/docs/current/reference/html[reference documentation] are the best places to start learning about Spring Data JPA. There are also https://github.com/spring-projects/spring-data-examples[two sample applications] available to look at.
The main project http://projects.spring.io/spring-data[website] contains links to basic project information such as source code, JavaDocs, Issue tracking, etc.
The main project https://projects.spring.io/spring-data[website] contains links to basic project information such as source code, JavaDocs, Issue tracking, etc.
For more detailed questions, use http://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow]. If you are new to Spring as well as to Spring Data, look for information about http://projects.spring.io[Spring projects]. You should also have a look at our new Spring Guides
http://spring.io/guides/gs/accessing-data-jpa/[Accessing Data with JPA] that leverages the simplified configuration provided by http://projects.spring.io/spring-boot/[Spring Boot] as well as http://spring.io/guides/gs/accessing-data-rest/[Accessing JPA Data with REST]..
For more detailed questions, use https://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow]. If you are new to Spring as well as to Spring Data, look for information about https://projects.spring.io[Spring projects]. You should also have a look at our new Spring Guides
https://spring.io/guides/gs/accessing-data-jpa/[Accessing Data with JPA] that leverages the simplified configuration provided by https://projects.spring.io/spring-boot/[Spring Boot] as well as https://spring.io/guides/gs/accessing-data-rest/[Accessing JPA Data with REST]..
== Quick Start
@ -54,7 +54,7 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
@@ -54,7 +54,7 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
----
@ -152,10 +152,10 @@ public class UserRepositoryIntegrationTest {
@@ -152,10 +152,10 @@ public class UserRepositoryIntegrationTest {
Here are some ways for you to get involved in the community:
* Get involved with the Spring community by helping out on http://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow] by responding to questions and joining the debate.
* Get involved with the Spring community by helping out on https://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow] by responding to questions and joining the debate.
* Create https://jira.spring.io/browse/DATAJPA[JIRA] tickets for bugs and new features and comment and vote on the ones that you are interested in.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from http://help.github.com/forking/[forks of this repository]. If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by http://spring.io/blog[subscribing] to spring.io.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from https://help.github.com/forking/[forks of this repository]. If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by https://spring.io/blog[subscribing] to spring.io.
Before we accept a non-trivial patch or pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement]. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. If you forget to do so, you'll be reminded when you submit a pull request. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
@ -163,10 +163,10 @@ Before we accept a non-trivial patch or pull request we will need you to https:/
@@ -163,10 +163,10 @@ Before we accept a non-trivial patch or pull request we will need you to https:/
Here are some ways for you to get involved in the community:
* Get involved with the Spring community by helping out on http://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow] by responding to questions and joining the debate.
* Get involved with the Spring community by helping out on https://stackoverflow.com/questions/tagged/spring-data-jpa[stackoverflow] by responding to questions and joining the debate.
* Create https://jira.spring.io/browse/DATAJPA[JIRA] tickets for bugs and new features and comment and vote on the ones that you are interested in.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from http://help.github.com/forking/[forks of this repository]. If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by http://spring.io/blog[subscribing] to spring.io.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from https://help.github.com/forking/[forks of this repository]. If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by https://spring.io/blog[subscribing] to spring.io.
Before we accept a non-trivial patch or pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement]. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. If you forget to do so, you'll be reminded when you submit a pull request. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
DAO :: Data Access Object - Pattern to separate persisting logic from the object to be persisted
Dependency Injection :: Pattern to hand a component's dependency to the component from outside, freeing the component to lookup the dependent itself. For more information, see link:$$http://en.wikipedia.org/wiki/Dependency_Injection$$[http://en.wikipedia.org/wiki/Dependency_Injection].
Dependency Injection :: Pattern to hand a component's dependency to the component from outside, freeing the component to lookup the dependent itself. For more information, see link:$$https://en.wikipedia.org/wiki/Dependency_Injection$$[https://en.wikipedia.org/wiki/Dependency_Injection].
@ -13,7 +13,7 @@ Oliver Gierke; Thomas Darimont; Christoph Strobl; Mark Paluch; Jay Bryant
@@ -13,7 +13,7 @@ Oliver Gierke; Thomas Darimont; Christoph Strobl; Mark Paluch; Jay Bryant
@ -25,9 +25,9 @@ The JPA module of Spring Data contains a custom namespace that allows defining r
@@ -25,9 +25,9 @@ The JPA module of Spring Data contains a custom namespace that allows defining r
@ -139,8 +139,8 @@ Saving an entity can be performed with the `CrudRepository.save(…)` method. It
@@ -139,8 +139,8 @@ Saving an entity can be performed with the `CrudRepository.save(…)` method. It
Spring Data JPA offers the following strategies to detect whether an entity is new or not:
* Id-Property inspection (*default*): By default Spring Data JPA inspects the identifier property of the given entity. If the identifier property is `null`, then the entity is assumed to be new. Otherwise, it is assumed to be not new.
* Implementing `Persistable`: If an entity implements `Persistable`, Spring Data JPA delegates the new detection to the `isNew(…)` method of the entity. See the link:$$http://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html$$[JavaDoc] for details.
* Implementing `EntityInformation`: You can customize the `EntityInformation` abstraction used in the `SimpleJpaRepository` implementation by creating a subclass of `JpaRepositoryFactory` and overriding the `getEntityInformation(…)` method accordingly. You then have to register the custom implementation of `JpaRepositoryFactory` as a Spring bean. Note that this should be rarely necessary. See the link:$$http://docs.spring.io/spring-data/data-jpa/docs/current/api/index.html?org/springframework/data/jpa/repository/support/JpaRepositoryFactory.html$$[JavaDoc] for details.
* Implementing `Persistable`: If an entity implements `Persistable`, Spring Data JPA delegates the new detection to the `isNew(…)` method of the entity. See the link:$$https://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html$$[JavaDoc] for details.
* Implementing `EntityInformation`: You can customize the `EntityInformation` abstraction used in the `SimpleJpaRepository` implementation by creating a subclass of `JpaRepositoryFactory` and overriding the `getEntityInformation(…)` method accordingly. You then have to register the custom implementation of `JpaRepositoryFactory` as a Spring bean. Note that this should be rarely necessary. See the link:$$https://docs.spring.io/spring-data/data-jpa/docs/current/api/index.html?org/springframework/data/jpa/repository/support/JpaRepositoryFactory.html$$[JavaDoc] for details.
[[jpa.query-methods]]
== Query Methods
@ -782,7 +782,7 @@ public class CustomerSpecs {
@@ -782,7 +782,7 @@ public class CustomerSpecs {
----
====
Admittedly, the amount of boilerplate leaves room for improvement (that may eventually be reduced by Java 8 closures), but the client side becomes much nicer, as you will see later in this section. The `_Customer` type is a metamodel type generated using the JPA Metamodel generator (see the link:$$http://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit$$[Hibernate implementation's documentation for an example]). So the expression, `_Customer.createdAt`, assumes the `Customer` has a `createdAt` attribute of type `Date`. Besides that, we have expressed some criteria on a business requirement abstraction level and created executable `Specifications`. So a client might use a `Specification` as follows:
Admittedly, the amount of boilerplate leaves room for improvement (that may eventually be reduced by Java 8 closures), but the client side becomes much nicer, as you will see later in this section. The `_Customer` type is a metamodel type generated using the JPA Metamodel generator (see the link:$$https://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit$$[Hibernate implementation's documentation for an example]). So the expression, `_Customer.createdAt`, assumes the `Customer` has a `createdAt` attribute of type `Date`. Besides that, we have expressed some criteria on a business requirement abstraction level and created executable `Specifications`. So a client might use a `Specification` as follows:
By default, CRUD methods on repository instances are transactional. For read operations, the transaction configuration `readOnly` flag is set to `true`. All others are configured with a plain `@Transactional` so that default transaction configuration applies. For details, see JavaDoc of link:$$http://docs.spring.io/spring-data/data-jpa/docs/current/api/index.html?org/springframework/data/jpa/repository/support/SimpleJpaRepository.html$$[`SimpleJpaRepository`]. If you need to tweak transaction configuration for one of the methods declared in a repository, redeclare the method in your repository interface, as follows:
By default, CRUD methods on repository instances are transactional. For read operations, the transaction configuration `readOnly` flag is set to `true`. All others are configured with a plain `@Transactional` so that default transaction configuration applies. For details, see JavaDoc of link:$$https://docs.spring.io/spring-data/data-jpa/docs/current/api/index.html?org/springframework/data/jpa/repository/support/SimpleJpaRepository.html$$[`SimpleJpaRepository`]. If you need to tweak transaction configuration for one of the methods declared in a repository, redeclare the method in your repository interface, as follows:
.Custom transaction configuration for CRUD
====
@ -1062,7 +1062,7 @@ A plain JPA setup requires all annotation-mapped entity classes to be listed in
@@ -1062,7 +1062,7 @@ A plain JPA setup requires all annotation-mapped entity classes to be listed in
----
====
NOTE: As of Spring 3.1, a package to scan can be configured on the `LocalContainerEntityManagerFactoryBean` directly to enable classpath scanning for entity classes. See the link:$$http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.html#setPackagesToScan(java.lang.String...)$$[JavaDoc] for details.
NOTE: As of Spring 3.1, a package to scan can be configured on the `LocalContainerEntityManagerFactoryBean` directly to enable classpath scanning for entity classes. See the link:$$https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.html#setPackagesToScan(java.lang.String...)$$[JavaDoc] for details.
@ -6,7 +6,7 @@ Spring Data JPA provides repository support for the Java Persistence API (JPA).
@@ -6,7 +6,7 @@ Spring Data JPA provides repository support for the Java Persistence API (JPA).
[[project]]
== Project Metadata
* Version control - http://github.com/spring-projects/spring-data-jpa
* Version control - https://github.com/spring-projects/spring-data-jpa
@ -80,7 +80,7 @@ public class AuditingBeanDefinitionParser implements BeanDefinitionParser {
@@ -80,7 +80,7 @@ public class AuditingBeanDefinitionParser implements BeanDefinitionParser {
@ -89,7 +89,7 @@ final class SimpleJpaQuery extends AbstractStringBasedJpaQuery {
@@ -89,7 +89,7 @@ final class SimpleJpaQuery extends AbstractStringBasedJpaQuery {
}catch(RuntimeExceptione){
// Needed as there's ambiguities in how an invalid query string shall be expressed by the persistence provider
@ -207,7 +207,7 @@ similar licenses that require the source code and/or modifications to
@@ -207,7 +207,7 @@ similar licenses that require the source code and/or modifications to
source code to be made available (as would be noted above), you may obtain a
copy of the source code corresponding to the binaries for such open source
components and modifications thereto, if any, (the "Source Files"), by
downloading the Source Files from http://www.springsource.org/download,
downloading the Source Files from https://www.springsource.org/download,
or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview
Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com. All
such requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention General
@ -13,5 +13,5 @@ The reference manual and javadoc are located in the 'docs' directory.
@@ -13,5 +13,5 @@ The reference manual and javadoc are located in the 'docs' directory.
ADDITIONAL RESOURCES:
Spring Data Homepage: http://projects.spring.io/spring-data
Spring Data JPA on Stackoverflow: http://stackoverflow.com/questions/tagged/spring-data-jpa
Spring Data Homepage: https://projects.spring.io/spring-data
Spring Data JPA on Stackoverflow: https://stackoverflow.com/questions/tagged/spring-data-jpa