Skip to content

Blog

Listening to events in SpringBoot

Jotting down some examples of different ways to handle events in Spring Boot

Entity Lifecycle

Entities, i.e. pojos annotated with @Entity, can utilize the following methods with annotations to manage life cycle events of the entity. JPA defines several lifecycle events that occur during an entity's persistence operations. You can use annotations to specify methods that should be executed when these events occur.

  • @PrePersist: Called before the entity is persisted (inserted into the database).
  • @PostPersist: Called after the entity is persisted.
  • @PreUpdate: Called before the entity is updated in the database.
  • @PostUpdate: Called after the entity is updated.
  • @PreRemove: Called before the entity is removed from the database.
  • @PostRemove: Called after the entity is removed.
  • @PostLoad: Called after the entity is loaded from the database.

MS SQL Installation

Just a note to self, that when installing the developer edition of MS SQL, TCP is not enabled, by default, so you cannot connect to the instance via the port, 1433, until you open Sql Server Configuration Manager, find SQL Server Network Configuration and enable TCP/IP. You can now connect.

Sudo Two-Factor Authentication

Two factor authentication for Sudo access gives you an awesome security enhancement so that a hacker still will not be able to use sudo, i.e. admin privileges, even if they have discovered your password.

Fireship.io tutorial

These are notes I ook on the flutter fireship io tutorial.

To create new project

flutter create --org com.wildetechsolutions myapp

To check flutters compatibility with all build modes, run

flutter doctor --verbose

Using Ubuntu Snap Store

Download Immich Distribution. When finished it will run on port 80, i.e. localhost. The persisted locations are found in

/var/snap/immich-distribution/common

i.e. you'll see the pgsql and upload folder here.

To see the snap variables run

snap get immich-distribution