Examples of Setor


Examples of hsv.beans.Setor

    public Setor consultarPorDescricao(String nomeSetor){
        Session session = HibernateUtil.getSessionFactory().openSession();
        session.beginTransaction();
        Query lista = session.createQuery("From Setor where nomeSetor = :descricao and codigoEmpresa=2");
        lista.setString("descricao", nomeSetor);
        Setor resultado = (Setor) lista.uniqueResult();
        session.getTransaction().commit();
        session.close();
        return resultado;
    }
View Full Code Here

Examples of maissocial.controle.Setor

        Logradouro lg = null;
        GrauEscolar ge = null;
        Uo uo = null;
        Profissao pf = null;
        GrupoUs gu = null;
        Setor st = null;
        Us us = null;

     
        try {
            lg = Fachada.getInstance().getLogradouroControle().pesquisarLogradouroPorCodigo(1);
View Full Code Here

Examples of maissocial.entidade.Setor

        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Setor st = pesquisarSetorPorCodigo(cod);
        session.delete(st);

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

Examples of maissocial.entidade.Setor

        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {setor.*} FROM setor {setor} WHERE cod_setor = "+cod);

        query.addEntity("setor", Setor.class);

        Setor st = null;
        if(query.list().size() > 0){
            st = (Setor) query.list().get(0);
        }
        session.close();
        return st;
View Full Code Here

Examples of maissocial.entidade.Setor

        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {setor.*} FROM setor {setor} WHERE descricao like '"+desc+"'");

        query.addEntity("setor", Setor.class);

        Setor st = null;
        if(query.list().size() > 0){
            st = (Setor) query.list().get(0);
        }
        session.close();
        return st;
View Full Code Here

Examples of maissocial.entidade.Setor

        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        Setor st2 = pesquisarSetorPorCodigo(st.getCodSetor());
        st.setCodSetor(st2.getCodSetor());
        session.update(st);

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

Examples of maissocial.entidade.Setor

*/
public class SetorGUI {

    public static void main(String[] args){

        Setor st = new Setor("T.I.", 1);

        try {
            Fachada.getInstance().getSetorControle().salvarSetor(st);
            JOptionPane.showMessageDialog(null, "Setor cadastrado com sucesso!");
            Setor st2 = Fachada.getInstance().getSetorControle().pesquisarSetorPorCodigo(1);
            System.out.print(st2.getDescricao());

        } catch (Exception ex) {
            Logger.getLogger(SetorGUI.class.getName()).log(Level.SEVERE, null, ex);
        }

View Full Code Here

Examples of maissocial.entidade.Setor

    public void salvarSetor(Setor st) throws Exception, SetorJaCadastradaException{
        if( st == null || st.getDescricao() == null || st.getDescricao().equals("") || st.getStatus() == 0){
            throw  new Exception("Parâmetros Inválidos!");
        }

        Setor st2 = this.stRep.pesquisarSetorPorDescricao(st.getDescricao());
        if(st2 == null){
            this.stRep.salvarSetor(st);
        }else{
            throw new SetorJaCadastradaException("Setor já cadastrado!");
        }
View Full Code Here

Examples of maissocial.entidade.Setor

    public void alterarSetor(Setor st) throws Exception, SetorJaCadastradaException{
        if( st == null || st.getDescricao() == null || st.getDescricao().equals("") || st.getStatus() == 0){
            throw  new Exception("Parâmetros Inválidos!");
        }

        Setor st2 = this.stRep.pesquisarSetorPorDescricao(st.getDescricao());
        if(st2 == null){
            this.stRep.alterarSetor(st);
        }else{
            throw new SetorJaCadastradaException("Setor já cadastrado!");
        }
View Full Code Here

Examples of maissocial.entidade.Setor

            throw new SetorJaCadastradaException("Setor já cadastrado!");
        }
    }

    public Setor pesquisarSetorPorCodigo(int cod){
        Setor st = this.stRep.pesquisarSetorPorCodigo(cod);
        return st;
    }
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.