Package org.hibernate

Examples of org.hibernate.Transaction.begin()


    public void salvarOrg(Org org){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(org);

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


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

        trans.begin();

        Org org = pesquisarOrgPorCodigo(cod);
        session.delete(org);

        trans.commit();
View Full Code Here

    public void deletarOrgPorObj(Org org){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(org);

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

    public void alterarOrg(Org org){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Org org2 = pesquisarOrgPorCodigo(org.getCodOrg());
        org.setCodOrg(org2.getCodOrg());
        session.update(org);
View Full Code Here

    public void salvarTipoMoradia(TipoMoradia md){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(md);

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

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

        trans.begin();

        TipoMoradia md = pesquisarTipoMoradiaPorCodigo(cod);
        session.delete(md);

        trans.commit();
View Full Code Here

    public void deletarTipoMoradiaPorObj(TipoMoradia md){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.delete(md);

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

    public void alterarTipoMoradia(TipoMoradia md){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        TipoMoradia md2 = pesquisarTipoMoradiaPorCodigo(md.getCodTipoMoradia());
        md.setCodTipoMoradia(md2.getCodTipoMoradia());
        session.update(md);
View Full Code Here

    public void salvarGrupoUs(GrupoUs gu){
        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        session.save(gu);

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

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

        trans.begin();

        GrupoUs gu = pesquisarGrupoUsPorCodigo(cod);
        session.delete(gu);

        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.