The error looks like org.hibernate.PersistentObjectException: detached entity passed to persist: example.forms.InvoiceItem at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:127) at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:799) at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:791) …
Hi Devs, Today I am going to show you how to create a simple spring boot project from scratch. Go to spring initializer to generate a spring boot project. Spring…
In this article, we are converting an array to ArrayList in Java. We will discuss three different ways to do that. So, I will show how to convert an Array…
Is java pass by reference? The answer is NO. Java is always pass-by-value. Today we will learn java pass by reference and java pass by value with examples. Let’s create Person class: package com.example; public…
Today we will learn, What is a NullPointerException, and how do I fix it? So, let’s start: What is NullPointException NullPointException is a RunTimeException. NullPointException is thrown when the value…
Operator are those who performs an action, for example + is an arithmetic operator that perform addition. They are various types of operators are available in java programming language. Types of…
In Java, data types refer to the type of data that can be stored in variables. Because Java is a tightly typed language, you must define the datatype of variables…
We’ll learn how to write our first Java program throughout this post. This article is only for java beginners. hello world program will be a very simple program that will…
Table of contents What is JDKFeatures of JDKWhat is JREFeatures of JREWhat is JVMMain Task of JVMFeatures of JVM What is JDK JDK is the acronym of JAVA Development Kit. JDK…
Java is one of the most used programming languages in the world for developing desktop application and web application. What is JAVA? Java is a platform independent, object oriented programming…
Serialization Serialization allows to convert an object to a stream, for sending that object over the network OR Save to file OR save into DB for letter usage. serialVersionUID It is…
Hi, This is a common problem when you want to run a java program using the command line. The problem is occurring for so many reasons. Most of the cause…
NullPointException NullPointException is a RunTimeException. NullPointException is thrown when the value of a reference variable or object is null. How to avoid NullPointException? Before using any object or reference variable,…
IOException In Java, IOException is one of the most common Exceptions when the program operates between input and output.IOException is used for input and output-related operations. Sometimes it’s called Input-Output Exception. Whatever the reason…
Exception Handling in Java is a powerful mechanism. Exception handling is done to handle the run time error of the program and to maintain normal flow. The exception refers to an abnormal…
Binding (or wrapping) code and data together into a single unit are known as encapsulation. For example, a capsule is wrapped with different medicines. Java Encapsulation reduces the code redundancy…
Hiding internal details and showing functionality is known as abstraction. For example phone call, we don't know the internal processing. The user will have the information on what the object…
If one task is performed in different ways, it is known as polymorphism. For example: to convince the customer differently, to draw something, for example, shape, triangle, rectangle, etc. In…