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_userquestionnaire_planningDAOImpl.java

License:Open Source License

public java.util.Iterator iterateKtek_userquestionnaire_planningByQuery(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   w w  w. j ava  2  s . co m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("Ktek_userquestionnaire_planning", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateKtek_userquestionnaire_planningByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

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

License:Open Source License

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

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

License:Open Source License

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

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

License:Open Source License

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

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

License:Open Source License

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

From source file:eu.epichub.gateway.eg.core.impl.gateway_configOptionDAOImpl.java

public List queryGateway_configOption(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From eu.epichub.gateway.eg.core.gateway_configOption as gateway_configOption");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {// www  .j  a v  a2 s .  c o  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("gateway_configOption", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error(
                "listGateway_configOptionByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:eu.epichub.gateway.eg.core.impl.gateway_configOptionDAOImpl.java

public java.util.Iterator iterateGateway_configOptionByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer(
            "From eu.epichub.gateway.eg.core.gateway_configOption as gateway_configOption");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/* www.j av a 2s .  c om*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("gateway_configOption", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateGateway_configOptionByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:eu.epichub.gateway.eg.core.impl.gateway_deviceDAOImpl.java

public List queryGateway_device(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From eu.epichub.gateway.eg.core.gateway_device as gateway_device");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/* ww w .  j a  v  a2 s .  co  m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("gateway_device", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error("listGateway_deviceByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}

From source file:eu.epichub.gateway.eg.core.impl.gateway_deviceDAOImpl.java

public java.util.Iterator iterateGateway_deviceByQuery(PersistentSession session, String condition,
        String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From eu.epichub.gateway.eg.core.gateway_device as gateway_device");
    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());
        query.setLockMode("gateway_device", lockMode);
        return query.iterate();
    } catch (Exception e) {
        _logger.error(
                "iterateGateway_deviceByQuery(PersistentSession session, String condition, String orderBy)", e);
        throw new PersistentException(e);
    }
}

From source file:eu.epichub.gateway.eg.core.impl.gateway_driverDAOImpl.java

public List queryGateway_driver(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From eu.epichub.gateway.eg.core.gateway_driver as gateway_driver");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*from  w  w w .  jav  a  2 s  . com*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("gateway_driver", lockMode);
        return query.list();
    } catch (Exception e) {
        _logger.error("listGateway_driverByQuery(PersistentSession session, String condition, String orderBy)",
                e);
        throw new PersistentException(e);
    }
}