Spring Team
Jens Schauder

Jens Schauder

Spring Data team member

Brunswick, Germany

Blog Posts by Jens Schauder

Spring Data Lovelace SR6, Kay SR14, Ingalls SR20 Released

On behalf of the entire team I’d like to announce the availability of three service releases for Spring Data release trains: Lovelace SR6, Kay SR14, and Ingalls SR20.

The releases are recommended upgrades as they contain fixes for a CVE in Spring Data JPA.

Spring Boot 2.1.4, 2.0.9, and 1.5.20 already pull in the above Spring Data versions, including the fixes that were released last week, and are now also available for use.

Here’s the content of the releases:

Spring Data Lovelace SR6

Read more...

Spring Data JDBC, References, and Aggregates

In my previous blog article, I described how to set up and use Spring Data JDBC. I also described the premise of making Spring Data JDBC easier to understand than JPA. This becomes interesting once you consider references. As a first example, consider the following domain model:

class PurchaseOrder {

  private @Id Long id;
  private String shippingAddress;
  private Set<OrderItem> items = new HashSet<>();

  void addItem(int quantity, String product) {
    items.add(createOrderItem(quantity, product));
  }

  private OrderItem createOrderItem(int quantity, String product) {

    OrderItem item = new OrderItem();
    item.product = product;
    item.quantity = quantity;
    return item;
  }
}
Read more...

Introducing Spring Data JDBC

With the upcoming Lovelace GA release, we’re going to ship a new Spring Data Module: Spring Data JDBC.

The idea behind Spring Data JDBC is to provide access to relational databases without submitting to the complexities of JPA. JPA offers such features as lazy loading, caching, and dirty tracking. While these are great if you need them, they can actually make thinking about JPA and its behavior harder than it has to be.

Lazy loading might trigger expensive statements when you don’t expect it or it might fail with an exception. Caching can get in your way when you actually want to compare two versions of an entity and being dirty makes it hard to find a single point where all persistence operations pass through.

Read more...