Example usage for org.hibernate.engine.spi NamedQueryDefinition getLockOptions

List of usage examples for org.hibernate.engine.spi NamedQueryDefinition getLockOptions

Introduction

In this page you can find the example usage for org.hibernate.engine.spi NamedQueryDefinition getLockOptions.

Prototype

public LockOptions getLockOptions() 

Source Link

Usage

From source file:org.babyfish.hibernate.internal.SessionImplWrapper.java

License:Open Source License

@SuppressWarnings("unchecked")
protected static XQuery createQuery(XSessionImplementor sessionProxy, NamedQueryDefinition namedQueryDefinition)
        throws HibernateException {
    String queryString = namedQueryDefinition.getQueryString();
    XQueryPlan xQueryPlan = (XQueryPlan) sessionProxy.getFactory().getQueryPlanCache()
            .getHQLQueryPlan(queryString, false, sessionProxy.getRawSessionImpl().getEnabledFilters());
    XQuery query = new XQueryImpl(queryString, namedQueryDefinition.getFlushMode(), sessionProxy,
            xQueryPlan.getParameterMetadata());
    query.setComment("named HQL query " + namedQueryDefinition.getName());
    if (namedQueryDefinition.getLockOptions() != null) {
        query.setLockOptions(namedQueryDefinition.getLockOptions());
    }/* w  w  w .  j a  va 2s.c  om*/
    return query;
}