Inject Prototype Bean into Singleton Bean in Spring – Lookup Method Injection

Lookup Method In this tutorial I am going to show you how lookup method injection works in Spring framework. You may face a situation where you need to inject prototype scoped bean into singleton scoped bean. For singleton scoped bean a new instance or object is created and the same is returned each time it is injected or looked up….

How to map Composite Primary Key to Entity Class in JPA Hibernate

In this example I am going to tell you how to map composite primary key to entity class in your JPA Hibernate entity class. Composite primary key is a combination of two or more columns made together as a primary key. Therefore the combination of column values will be as a unique instead of having a single column value as…

Find All Paths from Root to Leaf Nodes in Binary Tree using Java

In this example I am going to show you how to find all paths from root to leaf nodes in binary tree. So I am going to find each path from root to leaf node using Java program. A binary tree is a non-linear data structure type tree with at most two children for each parent. Every node in a…

Java To Find Common, Uncommon, Unique Elements In ArrayLists

Elements in ArrayList Here I am going to show you how to find common, uncommon, unique elements in two Lists or ArrayLists using Java program. In this program I will show you how to find common, uncommon, unique string elements as well as object elements in two ArrayLists. For identifying the unique string elements is very straight forward but for…

How To Create Custom Immutable Class In Java

Immutable Class in Java In this tutorial I am going to show you how to create custom immutable class in Java programming language. Immutable objects are those objects whose states cannot be changed. For example, you can change the state of an object by changing its attribute’s or field’s value. String is an example of an immutable class in Java….

How to deal with Whitelabel Error Page in Spring Boot Applications

In this tutorial I am going to discuss about what is Whitelabel Error Page and how to deal with Whitelabel Error Page in Spring Boot applications. Spring boot allows you to setup a Spring based application with minimal configurations. Spring MVC applications provide no default (fall-back) error page out of the box but Spring Boot based applications provide a fall-back…

CodeIgniter 4 Transaction Example

Introduction Here I am going to show you an example on CodeIgniter 4 transaction using MySQL database server. You know that transaction is an important part of persistence storage system because you may save, update or delete data from persistence storage any time. When you perform execution of multiple statement across different database or tables or any external system then…

How to display WordPress Popular Posts based on Views

You may want to display popular posts widget in your WordPress site. It serves as a great way to introduce your readers to the most popular contents. The contents you want to show may be posts or pages. Here I am going to show you how you can track and display most popular posts. Having most popular posts displayed on…

Spring Cloud Bus Example

Here I am going to build an application to show how to use Spring Cloud Bus. Let’s say you have multiple applications reading properties using Spring Cloud Config from centralized configuration files (for example, from Git repository). Spring Cloud Config is where you can have not only your all configurations centrally managed but also you can refresh them dynamically and…

How to call Stored Procedure in CodeIgniter 4

In this example I am going to show you how to call stored procedure in CodeIgniter 4. CodeIgniter 4 is a PHP based light weight web based framework for rapid application development. In this example I am going to use MySQL database server for storing data.