Home » Tag Archives: Spring Data

Tag Archives: Spring Data

Startup and shutdown scripts in Spring Data Cassandra

Shorter post this time round, it feels nice to get something finished faster than 2 weeks for once. Today we will look at startup and shutdown scripts in Spring Data Cassandra. This is something I probably should of done myself ages ago as it would of made testing my earlier posts much easier. I spent so much time (slightly over ...

Read More »

More complex modelling with Spring Data Cassandra

I’ve got a bit more Spring Data Cassandra for you now, this will be my 4th post on the subject and I should probably get onto something else but your stuck with this for now! In this post we will look at a slightly larger example than what I have shown in my previous posts so that we can have ...

Read More »

Multiple keyspaces using a single Spring Data CassandraTemplate

Following on from my last post Separate keyspaces with Spring Data Cassandra we will continue looking into using multiple keyspaces in Cassandra but this time focusing on using a single CassandraTemplate to perform queries, rather than creating extra templates for each keyspace that is being used. This removes the need to create extra sessions as each CassandraTemplate uses a session ...

Read More »

Separate keyspaces with Spring Data Cassandra

Following on from my previous post Getting started with Spring Data Cassandra we will look into using multiple keyspaces within an application. This will be a relatively short post due to most of the content being covered in the earlier post allowing us to focus on the code needed to allow multiple keyspaces and reasons why you might want to ...

Read More »

Getting started with Spring Data Cassandra

I have recently been learning Apache Cassandra to use at work and I think it is about time I consolidated my experience within a blog post. But rather than focusing on how Cassandra works itself this post will look at how to use Spring Data Cassandra. I know I just said I wouldn’t focus on how Cassandra works, but if ...

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 »

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 »