Search in sources :

Example 1 with NativeQueryImpl

use of org.hibernate.query.internal.NativeQueryImpl in project hibernate-orm by hibernate.

the class AbstractSharedSessionContract method getNamedSQLQuery.

@Override
public NativeQueryImplementor getNamedSQLQuery(String name) {
    final NativeQueryImpl nativeQuery = (NativeQueryImpl) getNamedNativeQuery(name);
    nativeQuery.setZeroBasedParametersIndex(true);
    return nativeQuery;
}
Also used : NativeQueryImpl(org.hibernate.query.internal.NativeQueryImpl)

Example 2 with NativeQueryImpl

use of org.hibernate.query.internal.NativeQueryImpl in project hibernate-orm by hibernate.

the class AbstractSharedSessionContract method createNativeQuery.

@SuppressWarnings({ "WeakerAccess", "unchecked" })
protected <T> NativeQueryImplementor createNativeQuery(NamedSQLQueryDefinition queryDefinition, Class<T> resultType) {
    if (resultType != null) {
        resultClassChecking(resultType, queryDefinition);
    }
    final NativeQueryImpl query = new NativeQueryImpl(queryDefinition, this, factory.getQueryPlanCache().getSQLParameterMetadata(queryDefinition.getQueryString(), false));
    query.setHibernateFlushMode(queryDefinition.getFlushMode());
    query.setComment(queryDefinition.getComment() != null ? queryDefinition.getComment() : queryDefinition.getName());
    if (queryDefinition.getLockOptions() != null) {
        query.setLockOptions(queryDefinition.getLockOptions());
    }
    initQueryFromNamedDefinition(query, queryDefinition);
    applyQuerySettingsAndHints(query);
    return query;
}
Also used : NativeQueryImpl(org.hibernate.query.internal.NativeQueryImpl)

Example 3 with NativeQueryImpl

use of org.hibernate.query.internal.NativeQueryImpl in project hibernate-orm by hibernate.

the class AbstractSharedSessionContract method getNativeQueryImplementor.

protected NativeQueryImplementor getNativeQueryImplementor(String queryString, boolean isOrdinalParameterZeroBased) {
    checkOpen();
    checkTransactionSynchStatus();
    delayedAfterCompletion();
    try {
        NativeQueryImpl query = new NativeQueryImpl(queryString, false, this, getFactory().getQueryPlanCache().getSQLParameterMetadata(queryString, isOrdinalParameterZeroBased));
        query.setComment("dynamic native SQL query");
        return query;
    } catch (RuntimeException he) {
        throw exceptionConverter.convert(he);
    }
}
Also used : NativeQueryImpl(org.hibernate.query.internal.NativeQueryImpl)

Example 4 with NativeQueryImpl

use of org.hibernate.query.internal.NativeQueryImpl in project hibernate-orm by hibernate.

the class AbstractSharedSessionContract method getNativeQueryImplementor.

private NativeQueryImplementor getNativeQueryImplementor(NamedSQLQueryDefinition queryDefinition, ParameterMetadata parameterMetadata) {
    final NativeQueryImpl query = new NativeQueryImpl(queryDefinition, this, parameterMetadata);
    query.setComment(queryDefinition.getComment() != null ? queryDefinition.getComment() : queryDefinition.getName());
    initQueryFromNamedDefinition(query, queryDefinition);
    applyQuerySettingsAndHints(query);
    return query;
}
Also used : NativeQueryImpl(org.hibernate.query.internal.NativeQueryImpl)

Aggregations

NativeQueryImpl (org.hibernate.query.internal.NativeQueryImpl)4