Example usage for org.hibernate Query iterate

List of usage examples for org.hibernate Query iterate

Introduction

In this page you can find the example usage for org.hibernate Query iterate.

Prototype

Iterator<R> iterate();

Source Link

Document

Return the query results as an Iterator.

Usage

From source file:diagrama_bd.base_de_datos.ServicioDAO.java

public static java.util.Iterator iterateServicioByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.Servicio as Servicio");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   ww  w.j a  v  a 2s  .c o  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Servicio", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServiciosCombiDAO.java

public static java.util.Iterator iterateServiciosCombiByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServiciosCombi as ServiciosCombi");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/* ww w .  j ava2  s .  c  o  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServiciosCombiDAO.java

public static java.util.Iterator iterateServiciosCombiByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServiciosCombi as ServiciosCombi");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w ww . j ava  2  s. c o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("ServiciosCombi", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServiciosFFMDAO.java

public static java.util.Iterator iterateServiciosFFMByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServiciosFFM as ServiciosFFM");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   www. jav a  2s .  c o m
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServiciosFFMDAO.java

public static java.util.Iterator iterateServiciosFFMByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServiciosFFM as ServiciosFFM");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*  www .  ja va 2 s  .c  om*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("ServiciosFFM", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServicioTVDAO.java

public static java.util.Iterator iterateServicioTVByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServicioTV as ServicioTV");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w w w. j  a v  a  2s.c om
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.ServicioTVDAO.java

public static java.util.Iterator iterateServicioTVByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.ServicioTV as ServicioTV");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from   w ww .j a va 2  s .  c om*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("ServicioTV", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.TerminalesDAO.java

public static java.util.Iterator iterateTerminalesByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.Terminales as Terminales");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*ww w.  ja va  2  s .  co  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.TerminalesDAO.java

public static java.util.Iterator iterateTerminalesByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.Terminales as Terminales");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from  www .j  a  va 2  s. c  o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Terminales", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.TipoIncidenciaDAO.java

public static java.util.Iterator iterateTipoIncidenciaByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.TipoIncidencia as TipoIncidencia");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  w w w  .  ja v  a 2s.c o  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}