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:edu.mgupi.pass.db.locuses.LModulesFactory.java

public static java.util.Iterator iterateLModulesByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From edu.mgupi.pass.db.locuses.LModules as LModules");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from w  w w. ja v a2s  .c o  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error("iterateLModulesByQuery(PersistentSession session, String condition, String orderBy)", e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedFilterParamsFactory.java

public static java.util.Iterator iterateLocusAppliedFilterParamsByQuery(PersistentSession session,
        String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedFilterParams as LocusAppliedFilterParams");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  w w w.  j  a  va 2s .c o  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedFilterParamsByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedFilterParamsFactory.java

public static java.util.Iterator iterateLocusAppliedFilterParamsByQuery(PersistentSession session,
        String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedFilterParams as LocusAppliedFilterParams");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from w w  w. jav a 2s.c o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedFilterParamsByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedFiltersFactory.java

public static java.util.Iterator iterateLocusAppliedFiltersByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedFilters as LocusAppliedFilters");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   www . j a v  a 2  s .  c  o m
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedFiltersByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedFiltersFactory.java

public static java.util.Iterator iterateLocusAppliedFiltersByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedFilters as LocusAppliedFilters");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from w  w w.ja va2s . c o m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedFiltersByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedModuleFactory.java

public static java.util.Iterator iterateLocusAppliedModuleByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedModule as LocusAppliedModule");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w  w w.ja  v  a2s .  c om
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedModuleByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedModuleFactory.java

public static java.util.Iterator iterateLocusAppliedModuleByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedModule as LocusAppliedModule");
    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  2  s. c o m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedModuleByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedModuleParamsFactory.java

public static java.util.Iterator iterateLocusAppliedModuleParamsByQuery(PersistentSession session,
        String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedModuleParams as LocusAppliedModuleParams");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from w  ww .ja v  a 2s .c om*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedModuleParamsByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusAppliedModuleParamsFactory.java

public static java.util.Iterator iterateLocusAppliedModuleParamsByQuery(PersistentSession session,
        String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From edu.mgupi.pass.db.locuses.LocusAppliedModuleParams as LocusAppliedModuleParams");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from   w  ww. j  a  va2 s .c  o  m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateLocusAppliedModuleParamsByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:edu.mgupi.pass.db.locuses.LocusesFactory.java

public static java.util.Iterator iterateLocusesByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From edu.mgupi.pass.db.locuses.Locuses as Locuses");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  ww w  .j ava 2 s . c om*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        _logger.error("iterateLocusesByQuery(PersistentSession session, String condition, String orderBy)", e);
        throw new PersistentException(e);
    }
}