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 […]
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 […]
In this post, we will discuss the @PrePersist and the @PreUpdate annotations and how and why they are used in a JPA / Hibernate environment. What are the @PrePersist and @PreUpdate annotations The @PrePersist and @PreUpdate annotations are JPA annotations introduced in JPA 1.0. Both annotations are callback annotations which are called on specific entity […]
In this tutorial, we will discuss how to audit data and generating audit logs and data history entries using JaVers in a Spring boot and MongoDB environment. Prerequistes If you currently do not have a Spring boot environment set up with a MongoDB backend, then we suggest that you check out our Spring boot and MongoDB […]
In this post, we will configure a Spring boot application to use a MongoDB persistence back-end. Introduction MongoDB is NoSQL, cross-platform, document based database engine. It was initially release in 2009 but has been increasingly popular over the years thanks to its scaleability and increased popularity of NoSQL database systems. Unlike traditional relational database systems […]
A BigInteger is a data structure in Java that is used to represent very large numerical values that would otherwise not fit within a primitive data type such as an int or long. In this post, we will discuss different ways to initialize a BigInteger and how to use it to perform mathematical […]
In this post, we will discuss two different types of Spring beans, singleton and prototype beans and we will also discuss when to use prototype beans and when to use singleton beans. Singleton beans Most beans that you will use or encounter are singleton beans. Singleton beans are initialized once, either when the application context […]
In this post, we will discuss how to write a simple Java program to find prime numbers between 1 and 100. We will be using a simple algorithm implemented in nested loops. So let us get started! What is a prime number? A prime number is a number which can only be divided […]
In this post, we will discuss how to encrypt and decrypt a file using the AES encryption algorithm in GCM mode. We will start by writing a file reader / writer to read and write files into byte arrays. Then we will attempt to encrypt and decrypt these byte arrays. This example has been written […]
To improve our website, we would like to ask for your help filling out a short survey.
We only need 5 minutes of your time to tell us your opinion about our website. We will not ask for your email address!
Thank you very much!
Survey link: here