Spring Data Relational
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Mark Paluch c5344e31a9 DATAJDBC-382 - Create security policy readme. 7 years ago
.mvn/wrapper DATAJDBC-336 - URL Cleanup. 7 years ago
ci DATAJDBC-316 - Polishing. 7 years ago
spring-data-jdbc DATAJDBC-377 - Use testcontainers version property. 7 years ago
spring-data-jdbc-distribution DATAJDBC-363 - Prepare next development iteration. 7 years ago
spring-data-relational DATAJDBC-374 - Introduce shortcuts for Embedded#onEmpty(…) 7 years ago
src/main DATAJDBC-374 - Polishing. 7 years ago
.gitignore DATAJDBC-324 - Polishing. 7 years ago
.travis.yml DATAJDBC-320 - Removed container-license-acceptance.txt. 7 years ago
CODE_OF_CONDUCT.adoc DATAJDBC-336 - URL Cleanup. 7 years ago
README.adoc DATAJDBC-365 - Fix typos in readme. 7 years ago
SECURITY.adoc DATAJDBC-382 - Create security policy readme. 7 years ago
lombok.config DATAJDBC-99 - Polishing. 9 years ago
mvnw DATAJDBC-340 - Polishing. 7 years ago
mvnw.cmd DATAJDBC-340 - Polishing. 7 years ago
pom.xml DATAJDBC-377 - Use testcontainers version property. 7 years ago
run-tests-against-all-dbs.sh DATAJDBC-168 - Run integration tests with testcontainers. 8 years ago

README.adoc

image:https://spring.io/badges/spring-data-jdbc/ga.svg["Spring Data JDBC", link="https://spring.io/projects/spring-data-jdbc#learn"]
image:https://spring.io/badges/spring-data-jdbc/snapshot.svg["Spring Data JDBC", link="https://spring.io/projects/spring-data-jdbc#learn"]

= Spring Data Relational

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. *Spring Data Relational* offers the popular Repository abstraction based on link:spring-data-jdbc[JDBC].

It aims at being conceptually easy.
In order to achieve this it does NOT offer caching, lazy loading, write behind or many other features of JPA.
This makes Spring Data JDBC a simple, limited, opinionated ORM.

== Features

* Implementation of CRUD methods for Aggregates.
* `@Query` annotation
* Support for transparent auditing (created, last changed)
* Events for persistence events
* Possibility to integrate custom repository code
* JavaConfig based repository configuration by introducing `EnableJdbcRepository`
* Integration with MyBatis

== Maven Coordinates

[source,xml]
----
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
</dependency>
----

== Modules

Spring Data Relational ships with multiple modules:

* Spring Data Relational: Common infrastructure abstracting general aspects of relational database access.
* link:spring-data-jdbc[Spring Data JDBC]: Repository support for JDBC-based datasources.

== Getting Help

If you are new to Spring Data JDBC read the following two articles https://spring.io/blog/2018/09/17/introducing-spring-data-jdbc["Introducing Spring Data JDBC"] and https://spring.io/blog/2018/09/24/spring-data-jdbc-references-and-aggregates["Spring Data JDBC, References, and Aggregates"]

There are also examples in the https://github.com/spring-projects/spring-data-examples/tree/master/jdbc[Spring Data Examples] project.

A very good source of information is the source code in this repository.
Especially the integration tests (if you are reading this on github, type `t` and then `IntegrationTests.java`)

We are keeping an eye on the https://stackoverflow.com/questions/tagged/spring-data-jdbc[spring-data-jdbc tag on stackoverflow].

If you think you found a bug, or have a feature request please https://jira.spring.io/browse/DATAJDBC/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel[create a ticket in our issue tracker].

== Building from Source

You don't need to build from source to use Spring Data Relational (binaries in https://repo.spring.io[repo.spring.io]).
If you want to try out the latest and greatest, Spring Data Relational can be easily built with Maven.
You also need JDK 1.8.

[source]
----
$ mvn clean install
----

=== Fast running tests

Fast running tests can be executed with a simple

[source]
----
$ mvn test
----

This will execute unit tests and integration tests using an in-memory database.

=== Running tests with a real database

In order to run the integration tests against a specific database you need to have a local Docker installation available, and then execute.

[source]
----
$ mvn test -Dspring.profiles.active=<databasetype>
----

This will also execute the unit tests.

Currently the following _databasetypes_ are available:

* hsql (default, does not require a running database)
* mysql
* postgres
* mariadb
* mssql

=== Run tests with all databases

[source]
----
$ mvn test -Pall-dbs
----

This will execute the unit tests, and all the integration tests with all the databases we currently support for testing. Running the integration-tests depends on Docker.

== Contributing to Spring Data Relational

Here are some ways for you to get involved in the community:

* Get involved with the Spring community by helping out on Stackoverflow for https://stackoverflow.com/questions/tagged/spring-data-jdbc[Spring Data JDBC] by responding to questions and joining the debate.
* Create https://jira.spring.io/browse/DATAJDBC[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 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.

== License

link:src/main/resources/license.txt[The license under which Spring Data Relational is published can be found here].