Example usage for org.hibernate Session merge

List of usage examples for org.hibernate Session merge

Introduction

In this page you can find the example usage for org.hibernate Session merge.

Prototype

Object merge(Object object);

Source Link

Document

Copy the state of the given object onto the persistent object with the same identifier.

Usage

From source file:Services.KlerenService.java

public static Kleren KlerenUpdate(int id, Kleren kleren) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    kleren.setId(id);/*from  w w w . jav a2  s  . c o m*/
    s.beginTransaction();
    s.merge(kleren);
    s.getTransaction().commit();

    return kleren;
}