Package org.hibernate

Examples of org.hibernate.Transaction.begin()


    public void salvarTipoAbastAgua(TipoAbastAgua ta){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(ta);

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


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

        trans.begin();

        TipoAbastAgua ta = pesquisarTipoAbastAguaPorCodigo(cod);
        session.delete(ta);

        trans.commit();
View Full Code Here

    public void deletarTipoAbastAguaPorObj(TipoAbastAgua ta){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(ta);

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

    public void alterarTipoAbastAgua(TipoAbastAgua ta){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        TipoAbastAgua ta2 = pesquisarTipoAbastAguaPorCodigo(ta.getCodTipoAbastAgua());
        ta.setCodTipoAbastAgua(ta2.getCodTipoAbastAgua());
        session.update(ta);
View Full Code Here

    public void salvarPis(Pis pis){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(pis);

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

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

        trans.begin();

        Pis pis = pesquisarPisPorCodigo(cod);
        session.delete(pis);

        trans.commit();
View Full Code Here

    public void deletarPisPorObj(Pis pis){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(pis);

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

    public void alterarPis(Pis pis){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Pis pis2 = pesquisarPisPorCodigo(pis.getCodPis());
        pis.setCodPis(pis2.getCodPis());
        session.update(pis);
View Full Code Here

    public void salvarTipoSanit(TipoSanit tt){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(tt);

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

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

        trans.begin();

        TipoSanit tt = pesquisarTipoSanitPorCodigo(cod);
        session.delete(tt);

        trans.commit();
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.