GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Spring Lemon Commons JPA Guide

Spring Lemon Commons JPA Guide

Jump to bottom
Sanjay Patel edited this page Jan 12, 2019 · 3 revisions

spring-lemon-commons-jpa includes spring-lemon-commons-web and adds Spring Data JPA to it. It comes with a couple of features, discussed below.

LemonEntity

LemonEntity is a base JPA entity class, with support for auditing, optimistic locking, and permission evaluation. When you need any of these features in an entity, inherit that from this one.

How to execute some code only after successful commit

Sometimes you'll need to execute some code only after a successful database commit. For example, you should send verification mail to a user only after his registration data is committed to the database. Use LecjUtils.afterCommit method in such cases.

How to ensure that some data being updated isn't stale

LecjUtils.ensureCorrectVersion can be used for ensuring some data isn't stale, particularly after an edit request received from front-end. Check out how it's used when editing a user, in LemonService.updateUser.

Clone this wiki locally

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.