Home » Tag Archives: Spring Data

Tag Archives: Spring Data

Spring Data JPA Tutorial

java-interview-questions-answers

Managing data between java classes or objects and the relational database is a very cumbersome and tricky task. The DAO layer usually contains a lot of boilerplate code that should be simplified in order to reduce the number of lines of code and make the code reusable. In this tutorial, we will discuss spring data’s implementation of JPA. 1. Introduction ...

Read More »

Interacting with Cassandra using the Datastax Java driver

I’m back with more Cassandra and Java integration today this time focusing on using the Datastax Java driver rather than Spring Data Cassandra which I have already written about quite a lot. The Datastax driver is actually used by Spring Data to interact with Cassandra but comes with some extra goodies built on top of it. But we don’t want ...

Read More »

Spring Data MongoDB Tutorial

spring-interview-questions-answers

In today’s world it is very important to get the application up and running as soon as possible. The application should also be easy to develop and maintain. Spring is such framework which provides the ease of integration with a lot of different frameworks which makes it easy to develop an application using Spring. One such integration is integration of ...

Read More »

Spring Boot & Angular 5 & Spring Data & Rest Example (CRUD)

This tutorial provides a complete implementation of Spring Boot, Angular 5 and spring data to build an end to end single page java web application with example.We will be using spring boot 1.5 to expose REST APIs and angular5 with routing to build our client that will be consuming the APIs exposed by the server.Also, we will be integrating MySql ...

Read More »

Access the EntityManager from Spring Data JPA

spring-interview-questions-answers

Spring Data JPA allows you to rapidly develop your data access layer through the use of Repository interfaces. Occasionally you will need to access the EntityManager from Spring Data JPA. This post shows you how to access the EntityManager. EntityManager The purpose of the EntityManager is to interact with the persistence context. The persistence context will then manage entity instances ...

Read More »

Add EntityManager.refresh to all Spring Data Repositories

spring-interview-questions-answers

In my previous post Access the EntityManager from Spring Data JPA I showed how to extend a single Spring Data JPA repository to access the EntityManager.refresh method. This post demonstrates how to Add EntityManager.refresh to all Spring Data Repositories. Source Code The first step is to define your interface – package com.glenware.springboot.repository; import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.Repository; import org.springframework.data.repository.CrudRepository; import java.io.Serializable; ...

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 »