Package org.hibernate

Examples of org.hibernate.SQLQuery$ReturnProperty


    }


    public List pesquisarTipoSitOcupacionalTodos(){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {tipo_sit_ocupacional.*} FROM tipo_sit_ocupacional {tipo_sit_ocupacional}");

        query.addEntity("tipo_sit_ocupacional", TipoSitOcupacional.class);

        List to = query.list();

        session.close();
        return to;
    }
View Full Code Here


    }


    public Familia pesquisarFamiliaPorCodigo(int cod){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {familia.*} FROM familia {familia} WHERE cod_familia = "+cod);

        query.addEntity("familia", Familia.class);

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

    }


    public List pesquisarFamiliaTodos(){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {familia.*} FROM familia {familia}");

        query.addEntity("familia", Familia.class);

        List fm = query.list();

        session.close();
        return fm;
    }
View Full Code Here

    }


    public Logradouro pesquisarLogradouroPorCodigo(int cod){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {logradouro.*} FROM logradouro {logradouro} WHERE cod_logradouro = "+cod);

        query.addEntity("logradouro", Logradouro.class);

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

        return lg;
    }

    public Logradouro pesquisarLogradouroPorNome(String nome){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {logradouro.*} FROM logradouro {logradouro} WHERE nome like '"+nome+"'");

        query.addEntity("logradouro", Logradouro.class);

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

    }


    public List pesquisarLogradouroTodos(){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {logradouro.*} FROM logradouro {logradouro}");

        query.addEntity("logradouro", Logradouro.class);

        List lg = query.list();

        session.close();
        return lg;
    }
View Full Code Here

    }


    public Org pesquisarOrgPorCodigo(int cod){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {org.*} FROM org {org} WHERE cod_org = "+cod);

        query.addEntity("org", Org.class);

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

    }


    public Org pesquisarOrgPorCnpj(String cnpj){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {org.*} FROM org {org} WHERE cnpj = "+cnpj);

        query.addEntity("org", Org.class);

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

    }
   

    public Org pesquisarOrgPorNome(String nome){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {org.*} FROM org {org} WHERE nome like '"+nome+"'");

        query.addEntity("org", Org.class);

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

        return org;
    }

    public List pesquisarOrgTodos(){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {org.*} FROM org {org}");

        query.addEntity("org", Org.class);

        List org = query.list();

        session.close();
        return org;
    }
View Full Code Here

TOP

Related Classes of org.hibernate.SQLQuery$ReturnProperty

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.