Package org.hibernate

Examples of org.hibernate.Transaction.begin()


    public void deletarTipoSitOcupacionalPorObj(TipoSitOcupacional to){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(to);

        trans.commit();
        session.close();
View Full Code Here


    public void alterarTipoSitOcupacional(TipoSitOcupacional to){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        TipoSitOcupacional to2 = pesquisarTipoSitOcupacionalPorCodigo(to.getCodTipoSitOcupacional());
        to.setCodTipoSitOcupacional(to2.getCodTipoSitOcupacional());
        session.update(to);
View Full Code Here

    public void salvarFamilia(Familia fm){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(fm);

        trans.commit();
        session.close();
View Full Code Here

    public void deletarFamilia(int cod){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Familia fm = pesquisarFamiliaPorCodigo(cod);
        session.delete(fm);

        trans.commit();
View Full Code Here

    public void deletarFamiliaPorObj(Familia fm){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(fm);

        trans.commit();
        session.close();
View Full Code Here

    public void alterarFamilia(Familia fm){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Familia fm2 = pesquisarFamiliaPorCodigo(fm.getCodFamilia());
        fm.setCodFamilia(fm2.getCodFamilia());
        session.update(fm);
View Full Code Here

    public void salvarLogradouro(Logradouro lg){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(lg);

        trans.commit();
        session.close();
View Full Code Here

    public void deletarLogradouro(int cod){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Logradouro lg = pesquisarLogradouroPorCodigo(cod);
        session.delete(lg);

        trans.commit();
View Full Code Here

    public void deletarLogradouroPorObj(Logradouro lg){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(lg);

        trans.commit();
        session.close();
View Full Code Here

    public void alterarLogradouro(Logradouro lg){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Logradouro lg2 = pesquisarLogradouroPorCodigo(lg.getCodLogradouro());
        lg.setCodLogradouro(lg2.getCodLogradouro());
        session.update(lg);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.