Example usage for org.hibernate Session update

List of usage examples for org.hibernate Session update

Introduction

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

Prototype

void update(Object object);

Source Link

Document

Update the persistent instance with the identifier of the given detached instance.

Usage

From source file:com.atlanta.educati.daoImp.DocenteDaoImp.java

@Override
public int update(Docente x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//from   www  .j  av  a 2  s.co  m

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.EstudianteDaoImp.java

@Override
public int update(Estudiante x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//  w ww. j  av a  2s .  c o  m

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.HorarioDaoImp.java

@Override
public int update(Horario x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//ww  w. j av  a 2s. com

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.InstitucionDaoImp.java

@Override
public int update(Institucion x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;/*from   w  w  w .  j  a va 2s  . co m*/

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.MatriculaDaoImp.java

@Override
public int update(Matricula x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//from  w  ww . j  ava 2  s. c o m

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.ModalidadingresoDaoImp.java

@Override
public int update(Modalidadingreso x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//  w w  w .j a v a 2s  . co m

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.PermisoDaoImp.java

@Override
public int update(Permiso x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//from   ww  w .ja v a 2  s.  co m

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.PersonaDaoImp.java

@Override
public int update(Persona x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;//from   w ww .  j a va  2s  .  com

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.RendimientoDaoImp.java

@Override
public int update(Rendimiento x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;/*from   w w w . j  a va  2  s. com*/

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}

From source file:com.atlanta.educati.daoImp.TareaDaoImp.java

@Override
public int update(Tarea x) {
    Session sesion = sesionFactory.openSession();
    Transaction tx = sesion.beginTransaction();

    //Variable de respuesta
    int r = 0;/*  ww  w  . j a v  a  2 s.  co  m*/

    try {
        sesion.clear();
        sesion.update(x);
        tx.commit();

        r++;
    } catch (Exception e) {
        System.out.println("" + e.getMessage());
        tx.rollback();
    } finally {
        sesion.close();
    }

    return r;
}