Example usage for org.hibernate Query setLockMode

List of usage examples for org.hibernate Query setLockMode

Introduction

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

Prototype

Query<R> setLockMode(String alias, LockMode lockMode);

Source Link

Document

Set the LockMode to use for specific alias (as defined in the query's FROM clause).

Usage

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  w  w .j  a v  a  2s .c  om
        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 List queryServiciosFFM(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 {//  w  w w .  ja  v a 2 s. c om
        Query query = session.createQuery(sb.toString());
        query.setLockMode("ServiciosFFM", lockMode);
        return query.list();
    } 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 {/*from  w ww  .  ja  v a  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 List queryServicioTV(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.ja  v a  2s.co  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("ServicioTV", lockMode);
        return query.list();
    } 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 {/*w w w .  ja  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 List queryTerminales(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 ww  w.java 2  s. co  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Terminales", lockMode);
        return query.list();
    } 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 {// 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 List queryTipoIncidencia(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) 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.j  ava2 s .co  m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("TipoIncidencia", lockMode);
        return query.list();
    } 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, org.hibernate.LockMode lockMode) 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 ww w.ja  va 2s .  c om
        Query query = session.createQuery(sb.toString());
        query.setLockMode("TipoIncidencia", lockMode);
        return query.iterate();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:diagrama_bd.base_de_datos.TipoTerminalDAO.java

public static List queryTipoTerminal(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From diagrama_bd.base_de_datos.TipoTerminal as TipoTerminal");
    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 2 s .c  om*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("TipoTerminal", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}