How to resolve [A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance]

If you have come across the above error, chances are :

  1. You have two entities, a Parent and its Child.
  2. You are deleting (Or removing some old and adding new) Child records and updating the Parent.

Going through this post will help you resolve this error and provide you insight on the details of the solution (more…)

Continue Reading

How to divide two numbers without using division (/) operator in java / How to find remainder of division of two numbers using minus (-) operator / Java program to find remainder of division using –

Suppose you want to divide a number a by another number b in java, you will use a / b. So simple, isn’t it. But what if you are required to determine the result by using only minus(-) operator, that is, without using division (/) operator. (more…)

Continue Reading

Encoding (+) symbol in ajax request jQuery / jQuery ajax request removing (+) sign / How to send ‘+’ through AJAX post

Scenario

There may be a scenario where you are sending HTML form fields in ajax POST request or sending the value of a particular form field (let’s say input box) as a parameter in ajax request. For Example, suppose there is an input box on a web page with id “userName” and you send its value to the server in an ajax request as :

(more…)

Continue Reading

How to connect to database using DriverManagerDataSource in Spring

DriverManagerDataSouce class in Spring
Spring provides many ways to establish connection to a database and perform operations such as retrieval of records, insertion of new records and updating / deletion of existing records. The most basic of them is using class org.springframework.jdbc.datasource.DriverManagerDataSource. This post will detail it out in depth.

(more…)

Continue Reading

How to convert binary number to decimal in java

Overview

A binary number is a number which is composed of digits 1 and 0 such as 110011. A decimal number is a number which is composed of digits 0 to 9 such as 130672. It is a common requirement in computer programming to convert a binary number to decimal format and vice-versa. In this post, we will focus on different ways a binary number can be converted to a decimal number in java. (more…)

Continue Reading
Close Menu