TestNull.java Source code

Java tutorial

Introduction

Here is the source code for TestNull.java

Source

import model.entity.Staff;
import org.hibernate.Session;
import control.tools.MD5;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Wing
 */
public class TestNull {
    public static void main(String[] args) {
        Session ses = utils.HibernateUtils.getSessionFactory().getCurrentSession();
        Staff test = new Staff();
        test.setId(6);
        test.setUserName("Employee3");
        test.setPassword("33333333");
        test.setFirstName("fffff");
        ses.beginTransaction();
        ses.update(test);
        ses.getTransaction().commit();
        System.out.println("done");
    }
}