snowdrop / spring-data-example

Spring Boot Snowdrop Spring Data Booster
Apache License 2.0
3 stars 5 forks source link
example infinispan kubernetes openshift search spring-boot spring-data

== Purpose

A example that demonstrates how to configure and deploy a Spring Boot app using https://github.com/snowdrop/spring-data-snowdrop[Snowdrop's Spring Data] support, its embedded http://infinispan.org/[Infinispan] support to be exact.

== Deploying and interacting with the example

=== Spring Boot running locally

[source,bash]

mvn spring-boot:run

You then have 3 fields with which you can limit the search: author (auto-complete), text's content and release date. You can also select the order field and direction.

If any results match your critera, they should be listed below, once you hit "Search".

The whole idea behind Spring Data is to use this simple repository interfaces. This is the one we use in this example.

[source,java]

public interface BookRepository extends SnowdropCrudRepository<Book, Integer> { List findByAuthorLike(String author);

Stream<Book> findByTitleLike(String title);

List<Book> findByReleaseDate(LocalDate date, Pageable pageable);

List<Book> findByAuthor(String author, Pageable pageable);

List<Book> findByContentContains(String content, Pageable pageable);

}

=== Snowdrop and Spring Data

Currently we use Infinispan embedded integration. But the https://github.com/snowdrop/spring-data-snowdrop[Snowdrop Spring Data] project has other integrations as well -- with JPA, Infinispan remote and Google App Engine's Datastore.