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:com.coedil99.modello_di_dominio.impl.OrdineDAOImpl.java

public java.util.Iterator iterateOrdineByQuery(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.Ordine as Ordine");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/* w  w w . ja va 2 s .c  o  m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ordine", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:com.coedil99.modello_di_dominio.impl.PezzoDAOImpl.java

public java.util.Iterator iteratePezzoByQuery(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.Pezzo as Pezzo");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {// w ww  .  j a v a2  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:com.coedil99.modello_di_dominio.impl.PezzoDAOImpl.java

public java.util.Iterator iteratePezzoByQuery(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.Pezzo as Pezzo");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   www .j a v  a 2s  .c  om
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Pezzo", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:com.coedil99.modello_di_dominio.impl.RDADAOImpl.java

public java.util.Iterator iterateRDAByQuery(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.RDA as RDA");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//w  w w .  ja  v a2  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:com.coedil99.modello_di_dominio.impl.RDADAOImpl.java

public java.util.Iterator iterateRDAByQuery(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.RDA as RDA");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//  w  w  w .  j a v a2s  .co m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("RDA", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:com.coedil99.modello_di_dominio.impl.RigaDistintaDAOImpl.java

public java.util.Iterator iterateRigaDistintaByQuery(PersistentSession session, String condition,
        String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.RigaDistinta as RigaDistinta");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//w  ww. j a  va  2 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:com.coedil99.modello_di_dominio.impl.RigaDistintaDAOImpl.java

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

From source file:com.coedil99.modello_di_dominio.impl.RigaRDADAOImpl.java

public java.util.Iterator iterateRigaRDAByQuery(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.RigaRDA as RigaRDA");
    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. co  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:com.coedil99.modello_di_dominio.impl.RigaRDADAOImpl.java

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

From source file:com.coedil99.modello_di_dominio.impl.SagomaDAOImpl.java

public java.util.Iterator iterateSagomaByQuery(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From com.coedil99.modello_di_dominio.Sagoma as Sagoma");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from w  w w  . j  ava2  s.co  m*/
        Query query = session.createQuery(sb.toString());
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}