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:es.tekniker.framework.ktek.impl.Ktek_tpsettingsDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_tpsettingsByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From es.tekniker.framework.ktek.Ktek_tpsettings as Ktek_tpsettings");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w  w  w.j av  a 2  s .  c  om
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_tpsettings", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateKtek_tpsettingsByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_translation_textDAOImpl.java

License:Open Source License

public List queryKtek_translation_text(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From es.tekniker.framework.ktek.Ktek_translation_text as Ktek_translation_text");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from ww w. j a  va2  s.  co m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_translation_text", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error(
                "listKtek_translation_textByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_translation_textDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_translation_textByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From es.tekniker.framework.ktek.Ktek_translation_text as Ktek_translation_text");
    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 o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_translation_text", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateKtek_translation_textByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_unitDAOImpl.java

License:Open Source License

public List queryKtek_unit(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From es.tekniker.framework.ktek.Ktek_unit as Ktek_unit");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//  w w w .j  a  va 2  s .c o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_unit", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error("listKtek_unitByQuery(PersistentSession session, String condition, String orderBy)", e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_unitDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_unitByQuery(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From es.tekniker.framework.ktek.Ktek_unit as Ktek_unit");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from w  w w .j  av a 2  s  .co  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_unit", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error("iterateKtek_unitByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_unit_parameterDAOImpl.java

License:Open Source License

public List queryKtek_unit_parameter(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From es.tekniker.framework.ktek.Ktek_unit_parameter as Ktek_unit_parameter");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*www .j a va2  s .com*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_unit_parameter", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error(
                "listKtek_unit_parameterByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_unit_parameterDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_unit_parameterByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From es.tekniker.framework.ktek.Ktek_unit_parameter as Ktek_unit_parameter");
    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("Ktek_unit_parameter", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateKtek_unit_parameterByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_userDAOImpl.java

License:Open Source License

public List queryKtek_user(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From es.tekniker.framework.ktek.Ktek_user as Ktek_user");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//  w  ww.j  ava 2 s.  c  o m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_user", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error("listKtek_userByQuery(PersistentSession session, String condition, String orderBy)", e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_userDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_userByQuery(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From es.tekniker.framework.ktek.Ktek_user as Ktek_user");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  w  ww. j a v  a2 s .  c o  m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_user", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error("iterateKtek_userByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:es.tekniker.framework.ktek.impl.Ktek_userquestionnaire_planningDAOImpl.java

License:Open Source License

public List queryKtek_userquestionnaire_planning(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From es.tekniker.framework.ktek.Ktek_userquestionnaire_planning as Ktek_userquestionnaire_planning");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  www  . j a v a2s  .  com*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_userquestionnaire_planning", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error(
                "listKtek_userquestionnaire_planningByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}