Git Product home page Git Product logo

spring-data-examples's Introduction

Spring Data Examples

Build Status

This repository contains example projects for the different Spring Data modules to showcase the API and how to use the features provided by the modules.

We have separate folders for the samples of individual modules:

Spring Data for Apache Cassandra

  • example - Shows core Spring Data support for Apache Cassandra.

  • kotlin - Example for using Cassandra with Kotlin.

  • reactive - Example project to show reactive template and repository support.

Spring Data Elasticsearch

  • example - Example how to use basic text search, geo-spatial search and facets. It uses the High Level REST Client backing template and repository.

  • reactive - Example how to use reactive client, template and repository features.

Local Elasticsearch instance must be running to run the tests.

Spring Data JDBC

  • basic - Basic usage of Spring Data JDBC.

  • immutables - Showing Spring Data JDBC usage with Immutables

Spring Data JPA

  • eclipselink - Sample project to show how to use Spring Data JPA with Spring Boot and Eclipselink.

  • example - Probably the project you want to have a look at first. Contains a variety of sample packages, showcasing the different levels at which you can use Spring Data JPA. Have a look at the simple package for the most basic setup.

  • interceptors - Example of how to enrich the repositories with AOP.

  • jpa21 - Shows support for JPA 2.1 specific features (stored procedures support).

  • multiple-datasources - Examples of how to use Spring Data JPA with multiple `DataSource`s.

  • query-by-example - Example project showing usage of Query by Example with Spring Data JPA.

  • security - Example of how to integrate Spring Data JPA Repositories with Spring Security.

  • showcase - Refactoring show case of how to improve a plain-JPA-based persistence layer by using Spring Data JPA (read: removing close to all of the implementation code). Follow the demo.txt file for detailed instructions.

  • vavr - Shows the support of Vavr collection types as return types for query methods.

Spring Data LDAP

  • example - Sample for Spring Data repositories to access an LDAP store.

Spring Data MongoDB

  • aggregation - Example project to showcase the MongoDB aggregation framework support.

  • example - Example project for general repository functionality (including geo-spatial functionality), Querydsl integration and advanced topics.

  • fluent-api - Example project to show the new fluent API (MongoTemplate-alternative) to interact with MongoDB.

  • geo-json - Example project showing usage of GeoJSON with MongoDB.

  • gridfs - Example project showing usage of gridFS with MongoDB.

  • jmolecules - Example of Spring Data MongoDB working with a jMolecules based domain model.

  • kotlin - Example for using Kotlin with MongoDB.

  • linking - Example demonstrating possibilities for linking documents.

  • query-by-example - Example project showing usage of Query by Example with MongoDB.

  • querydsl - Example project showing imperative and reactive Querydsl support for MongoDB.

  • reactive - Example project to show reactive template and repository support.

  • repository-metrics - Example project to show how to collect repository method invocation metrics.

  • security - Example project showing usage of Spring Security with MongoDB.

  • text-search - Example project showing usage of MongoDB text search feature.

  • transactions - Example project for imperative and reactive MongoDB 4.0 transaction support.

Spring Data Neo4j

  • example - Example to show basic node and relationship entities and repository usage.

Spring Data R2DBC

  • example - Basic usage of Spring Data R2DBC.

Spring Data Redis

  • cluster - Example for Redis Cluster support.

  • example - Example for basic Spring Data Redis setup.

  • reactive - Example project to show reactive template support.

  • repositories - Example demonstrating Spring Data repository abstraction on top of Redis.

  • sentinel - Example for Redis Sentinel support.

  • streams - Example for Redis Streams support.

Local Redis instances must be running to run the tests. One option is to use Docker in a separate terminal:

$ docker run -p 6379:6379 redis:5.0
Warning
If you’re done using it, don’t forget to shut it down!

Spring Data REST

  • headers - A sample showing the population of HTTP headers and the usage of them to perform conditional GET requests.

  • multi-store - A sample REST web-service based on both Spring Data JPA and Spring Data MongoDB.

  • projections - A sample REST web-service showing how to use projections.

  • security - A sample REST web-service secured using Spring Security.

  • starbucks - A sample REST web-service built with Spring Data REST and MongoDB.

  • uri-customizations - Example project to show URI customization capabilities.

Spring Data web support

  • projections - Example for Spring Data web support for JSONPath and XPath expressions on projection interfaces.

  • querydsl - Example for Spring Data Querydsl web integration (creating a Predicate from web requests).

  • web - Example for Spring Data web integration (binding Pageable instances to Spring MVC controller methods, using interfaces to bind Spring MVC request payloads).

Miscellaneous

  • bom - Example project how to use the Spring Data release train bom in non-Spring-Boot scenarios.

  • map - Example project to show how to use Map-backed repositories.

  • multi-store - Example project to use both Spring Data MongoDB and Spring Data JPA in one project.

Note

  • The example projects make use of the Lombok plugin. To get proper code navigation in your IDE, you must install it separately. Lombok is available in the IntelliJ plugins repository and as a download for Eclipse-based IDEs.

  • The code makes use of Java 16 language features therefore you need Java 16 or newer to run and compile the examples.

  • Most store modules examples start their database via Testcontainers or as embedded/in-memory server unless stated otherwise.

spring-data-examples's People

Contributors

odrotbohm avatar mp911de avatar christophstrobl avatar schauder avatar gregturn avatar thomasdarimont avatar cbeams avatar michael-simons avatar fjacobs avatar wolfdale avatar yozaner1324 avatar meistermeier avatar luanne avatar derlucas avatar marcwrobel avatar mat3e avatar pdkovacs avatar maximatanasov avatar pjmeisch-cc avatar spring-operator avatar kumlien avatar ade90036 avatar deniswsrosa avatar mikereiche avatar kotmeow avatar hello-josh avatar jxblum avatar jrrickard avatar isopov avatar hlang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.