Package br.com.benefrancis.controle

Examples of br.com.benefrancis.controle.Servico


    }

    public static Servico consultar(int idServico) {
        Session session = ConexaoHibernate.getInstance();
        Transaction tx = null;
        Servico s = null;
        try {
            Query q;
            tx = session.beginTransaction();
            q = session.createQuery("FROM Servico as s where s.idServico=:id");
            q.setParameter("id", idServico);
View Full Code Here


        Collection<Servico> s = a.getServico();
        try {
            tx = session.beginTransaction();
            //Percorrendo a coleção de serviços
            for (Iterator iter = s.iterator(); iter.hasNext();) {
                Servico servico = (Servico) iter.next();
                session.save(servico);
            }
            tx.commit();
            return true;
        } catch (Exception e) {
View Full Code Here

        Collection<Servico> s = a.getServico();
        try {
            tx = session.beginTransaction();
            //Percorrendo a coleção de animais
            for (Iterator iter = s.iterator(); iter.hasNext();) {
                Servico servico = (Servico) iter.next();
                session.delete(servico);
            }
            tx.commit();
            return true;
        } catch (Exception e) {
View Full Code Here

        a.setRaca("Vira lata");
        a.setSexo('M');
        a.setObservacao("Cachorro muito sem vergonha!");
        a.setPessoa(pf);

        Servico s = new Banho();
        s.setData(new Date());
        s.setDescricao("Banho completo");
        s.setValor(20.95);
        s.setAnimal(a);

        Collection<Servico> serv = new ArrayList<Servico>();
        serv.add(s);
        a.setServico(serv);
View Full Code Here

TOP

Related Classes of br.com.benefrancis.controle.Servico

Copyright © 2018 www.massapicom. 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.