Package org.hibernate

Examples of org.hibernate.Query


    return getSession().createQuery(hql).list();
  }

  @SuppressWarnings("unchecked")
  public <T> List<T> searchHQLQuery(String hql, Map<String, Object> params) {
    Query query = getSession().createQuery(hql);
    return QuerySupport.setParameter(query, params).list();
  }
View Full Code Here


    return QuerySupport.setParameter(query, params).list();
  }

  @SuppressWarnings("unchecked")
  public <T> List<T> searchHQLQuery(String hql, Object... params) {
    Query query = getSession().createQuery(hql);
    return (List<T>) QuerySupport.setParameter(query, params).list();
  }
View Full Code Here

    return (List<T>) QuerySupport.setParameter(query, params).list();
  }

  @SuppressWarnings("unchecked")
  public <T> List<T> searchHQLQuery(String hql, final Map<String, Object> params, boolean cacheable) {
    Query query = getSession().createQuery(hql);
    query.setCacheable(cacheable);
    return QuerySupport.setParameter(query, params).list();
  }
View Full Code Here

    query.setCacheable(cacheable);
    return QuerySupport.setParameter(query, params).list();
  }

  public <T> Page<T> paginateNamedQuery(String queryName, Map<String, Object> params, PageLimit limit) {
    Query query = this.getSession().getNamedQuery(queryName);
    return paginateQuery(query, params, limit);
  }
View Full Code Here

    Query query = this.getSession().getNamedQuery(queryName);
    return paginateQuery(query, params, limit);
  }

  public <T> Page<T> paginateHQLQuery(String hql, Map<String, Object> params, PageLimit limit) {
    Query query = this.getSession().createQuery(hql);
    return paginateQuery(query, params, limit);
  }
View Full Code Here

  public void evict(Object entity) {
    getSession().evict(entity);
  }

  public int executeUpdateHql(final String queryStr, final Object... argument) {
    Query query = getSession().createQuery(queryStr);
    return QuerySupport.setParameter(query, argument).executeUpdate();
  }
View Full Code Here

    Query query = getSession().createQuery(queryStr);
    return QuerySupport.setParameter(query, argument).executeUpdate();
  }

  public int executeUpdateHqlRepeatly(final String queryStr, final List<Object[]> arguments) {
    Query query = getSession().createQuery(queryStr);
    int updated=0;
    for (Object[] params : arguments) {
      updated+= QuerySupport.setParameter(query, params).executeUpdate();
    }
    return updated;
View Full Code Here

    }
    return updated;
  }

  public int executeUpdateHql(final String queryStr, final Map<String, Object> parameterMap) {
    Query query = getSession().createQuery(queryStr);
    return QuerySupport.setParameter(query, parameterMap).executeUpdate();
  }
View Full Code Here

    Query query = getSession().createQuery(queryStr);
    return QuerySupport.setParameter(query, parameterMap).executeUpdate();
  }

  public int executeUpdateNamedQuery(final String queryName, final Map<String, Object> parameterMap) {
    Query query = getSession().getNamedQuery(queryName);
    return QuerySupport.setParameter(query, parameterMap).executeUpdate();
  }
View Full Code Here

    Query query = getSession().getNamedQuery(queryName);
    return QuerySupport.setParameter(query, parameterMap).executeUpdate();
  }

  public int executeUpdateNamedQuery(final String queryName, final Object... arguments) {
    Query query = getSession().getNamedQuery(queryName);
    return QuerySupport.setParameter(query, arguments).executeUpdate();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.Query

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.