In this tutorial, we will set up a Spring boot application to use Hibernate search with a Lucene indexing backend. This tutorial assumes that you already have a working Spring boot application with JPA/Hibernate configured. Please check out our tutorial “Getting started with Spring boot 2 and JPA” if you are new to Spring boot and […]
Configuring XStream to convert Java objects to and from XML
Serializing Java objects to and from XML is a necessary operation in many software systems. For example, when communicating with other systems and back-ends, or simply when storing and loading data. In this tutorial, we will discuss how to use the XStream library to convert Java objects to and from XML. What is XStream XStream […]
Configuring @PostLoad and @PostUpdate in JPA/Hibernate
In this post we will discuss how to use the @PostLoad and @PostUpdate annotations in Hibernate/JPA. This tutorial assumes that you have some knowledge of the @PreUpdate and @PrePersist annotations. If you are not familiar with these annotations, then please check our earlier post here. What are the @PostLoad and @PostUpdate annotations The @PostLoad and […]
Java Switch Statements – Uses, Advantages and Restrictions
In this tutorial, we will discuss what are Java switch statements, how to use them, the allowed data types that can be used in the switch statements and the advantages and restrictions that apply to them. What is a “switch” statement A “switch” statement in Java is a conditional operator used to direct […]
How to use @PrePersist and @PreUpdate in JPA/Hibernate
In this post, we will discuss the @PrePersist and the @PreUpdate annotations and how and why they are used in a JPA / Hibernate environment to configure entity insertion and update hooks. When configuring hooks and listeners for database operations, we need to be careful not to negatively affect the performance of the database or […]