Author: Editorial Team
-
Important interfaces of Hibernate
Following are the most important interfaces of Hibernate which act as base for using Hibernate: 1. org.hibernate.SessionFactory SessionFactory includes all of the metadata about Object/Relational Mapping. SessionFactory is a thread-safe and immutable. The JPA equivalent of SessionFactory is EntityManagerFactory. A SessionFactory is very expensive to create. So an application should have only one SessionFactory for…
-
Introduction to Hibernate Framework
1. Introduction In this tutorial, we’ll discuss about Hibernate. This tutorial should be considered as an introduction to Hibernate framework. We’ll discuss the problems which Hibernate solves and its capabilities. Hibernate is an Object/Relational Mapping solution for Java environments. This Object/Relational Mapping refers to the technique of mapping data from an object model representation to…
-
Spring Boot with Hibernate
In this tutorial, we’ll discuss how to integrate Spring Boot and Hibernate. In this tutorial, we’ll create a REST application and will integrate Hibernate. Step 1: Create a Spring Boot application with Hibernate dependencies In this tutorial we are using MySql as database. We’ll create a Spring Boot application with following dependencies: spring-boot-starter-data-jpa spring-boot-starter-web mysql-connector-java…
-
CyclicBarrier in Java
1. Introduction The CyclicBarrier allows a set of threads to all wait for each other to reach a common barrier point. This class is similar to the CountDownLatch class but the barrier in this case is reusable after the waiting threads are released and hence the name cyclic. CyclicBarrier is used when there is a…
-
CountDownLatch in Java
1. Introduction The Java concurrency API provides a CountDownLatch class that allows one or more threads to wait until a set of operations are done. CountDownLatch is initialized with an integer value (N). This count is the number of operations the threads are going to wait for. When a thread wants to wait for the…
-
JavaScript Optional Chaining Operator (?.)
1. Introduction The optional chaining operator (?.) enables you to read the property within a chain of connected objects without specifically checking each reference in the chain for null or undefined. The ?. operator short-circuits the chain and returns undefined if any reference in the chain is nullish (null or undefined). The behavior of ?.…
-
Aspect Oriented Programming with Spring – An Introduction
1. Introduction In every application there are layers such as UI layer, controller layer, service layer, DAO layer. The number of layers depends on the design and type of application. Across these layers, there are few aspects which are common. For example, logging is such aspect which is common across layers. Every layer has a…
-
Proxy design pattern – Java
1. Introduction Proxy means “power or authority that is given to allow an entity to act for someone else”. Proxy objects are used as surrogates and handlers for original objects. The objective of a proxy object is to control the creation of and access to the real object it represents. A common use of a…
-
Observer Pattern – Java
1. Introduction According to GoF definition, Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.Observer pattern is a behavioral design pattern. In this design pattern there is a subject to which observers subscribe. Whenever the state of subject changes, all its…
-
Simple Factory Pattern – Java
1. Introduction In this tutorial, we’ll discuss Factory Method Pattern. This design pattern comes under creational design pattern as this pattern is used to create objects. In this pattern, we hide the creation logic from the client. We only provide a uniform interface for creating objects.In this design pattern we define an interface for creating…
