Home » Tag Archives: Spring Data

Tag Archives: Spring Data

A quick look into Reactive Streams with Spring Data and MongoDB

This is a short post looking into Reactive Streams and how they can be used with MongoDB and Spring Data. This post won’t go into the depths of what Reactive Programming and Reactive Streams are as there have been plenty of posts covering that recently, such as What are Reactive Streams in Java and Reactive Spring 5 and Application Design Impact. ...

Read More »

Apache Ignite with Spring Data

java-interview-questions-answers

Spring Data provides a unified and easy way to access the different kinds of persistence store, both relational database systems, and NoSQL data stores. It is on top of JPA, adding another layer of abstraction and defining a standard-based design to support persistence Layer in a Spring context.                 Apache Ignite IgniteRepository implements Spring Data ...

Read More »

Testing Spring Data + Spring Boot applications with Arquillian (Part 2)

In previous post, I wrote about how to test Spring Data application using Docker with Arquillian Cube. The test looked like: @RunWith(SpringRunner.class) @SpringBootTest(classes = PingPongController.class, webEnvironment = RANDOM_PORT) @ContextConfiguration(initializers = PingPongSpringBootTest.Initializer.class) public class PingPongSpringBootTest { @ClassRule public static ContainerDslRule redis = new ContainerDslRule("redis:3.2.6") .withPortBinding(6379); @Autowired TestRestTemplate restTemplate; @Test public void should_get_pongs() { // given restTemplate.postForObject("/ping", "pong", String.class); restTemplate.postForObject("/ping", "pung", String.class); // when final List<String> ...

Read More »

Testing Spring Data + Spring Boot applications with Arquillian (Part 1)

spring-interview-questions-answers

Spring Data’s mission is to provide a familiar and consistent, Spring-based programming model for data access while still retaining the special traits of the underlying data store. It provides integration with several backend technologies such as JPA, Rest, MongoDB, Neo4J or Redis to cite a few. So if you are using Spring (Boot) then Spring Data is the right choice to deal ...

Read More »

Spring Web-Flux – Functional Style with Cassandra Backend

spring-interview-questions-answers

In a previous post I had walked through the basics of Spring Web-Flux which denotes the reactive support in the web layer of Spring framework. I had demonstrated an end to end sample using Spring Data Cassandra and using the traditional annotations support in the Spring Web Layers, along these lines: ... import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; ... @RestController @RequestMapping("/hotels") public class HotelController ...

Read More »

Spring Data with JPA and @NamedQueries

spring-interview-questions-answers

If you use Spring Data and @NamedQuery annotations at your JPA entity you can easily use them in a more convenient way using the spring data repository. On a previous blog we created a spring data project using spring boot and docker. We will use the pretty same project and enhance our repository’s functionality. We will implement a named query ...

Read More »

Spring boot and Spring data JPA integration

spring-interview-questions-answers

Nowadays spring and JPA integration has become a piece of cake thanks to Spring Boot and spring Data. I am gonna setup a postgresql server docker pull postgres #run the container docker run --name postgreslocal -e POSTGRES_PASSWORD=postgres -d postgres #get the ip docker inspect --format '{{ .NetworkSettings.IPAddress }}' postgreslocal #get the port docker inspect --format '{{ .NetworkSettings.Ports }}' postgreslocal Create ...

Read More »

Data Aggregation Spring Data MongoDB: Nested results

1 Introduction In a previous post, we built a basic example of an aggregation pipeline. Maybe you want to take a look at Data aggregation with Spring Data MongoDB and Spring Boot if you need more detail about how to create the project and configure the application. In this post, we will focus on learning a use case where it makes ...

Read More »

First steps to Spring Boot Cassandra

If you want to start using Cassandra NoSQL database with Spring Boot, the best resource is likely the Cassandra samples available here and the Spring data Cassandra documentation. Here I will take a little more roundabout way, by actually installing Cassandra locally and running a basic test against it and I aim to develop this sample into a more comprehensive example with the next ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns