merge function application in Hibernate

merge usage The below example shows usage of Hibernate Session.merge () API. Suppose you have a scenario like below : Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); User userA = (User)session.get(User.class, 1101); transaction.commit(); session.close(); Since session is closed, userA object is in a detached state . session = sessionFactory.openSession(); …

JSON with Spring REST – Basics

Spring JSON Hello Readers , In this article we will how to produce JSON out from Spring REST web services. The article uses a simple example to demonstrate how easy it is to map the data from Spring REST to JSON format. All it takes is some simple tweaking of …

Strategy Design Pattern in Java

Strategy Design Pattern Strategy Design Pattern is useful when there are family of algorithms and each algorithm is used in different scenarios. Strategy …

Lambda Expression without Formal Paramaters

Java Lambda Expression with No Formal Parameters Interface package com.codereq.corejava; public interface Print { String show(); } Implementation Class : package com.codereq.corejava; …

Hibernate One-to-Many Relationship

In this article we illustrate how to configure hibernate application to model one-to-many relationship  between entities. One-to-many relationship means one entity is …

Command Design Pattern in Java

Command Design Pattern In this article we will see the application of command design pattern and problem domain it tries to solve. …

unix faqs

Unix FAQs

UNIX FAQs The following faqs has list some commonly asked questions related to unix operating system. These also highlight some important concepts …

java faqs

Java FAQs

Java FAQs This java faqs is a list of commonly asked questions around java technology. The answers are brief and in simple language …