use of org.hibernate.engine.query.spi.NativeSQLQueryPlan in project hibernate-orm by hibernate.
the class StatelessSessionImpl method executeNativeUpdate.
@Override
public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters) throws HibernateException {
checkOpen();
queryParameters.validateParameters();
NativeSQLQueryPlan plan = getNativeQueryPlan(nativeSQLQuerySpecification);
boolean success = false;
int result = 0;
try {
result = plan.performExecuteUpdate(queryParameters, this);
success = true;
} finally {
afterOperation(success);
}
temporaryPersistenceContext.clear();
return result;
}
use of org.hibernate.engine.query.spi.NativeSQLQueryPlan in project hibernate-orm by hibernate.
the class SessionImpl method executeNativeUpdate.
@Override
public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters) throws HibernateException {
checkOpenOrWaitingForAutoClose();
checkTransactionSynchStatus();
queryParameters.validateParameters();
NativeSQLQueryPlan plan = getNativeQueryPlan(nativeQuerySpecification);
autoFlushIfRequired(plan.getCustomQuery().getQuerySpaces());
boolean success = false;
int result = 0;
try {
result = plan.performExecuteUpdate(queryParameters, this);
success = true;
} finally {
afterOperation(success);
delayedAfterCompletion();
}
return result;
}
use of org.hibernate.engine.query.spi.NativeSQLQueryPlan in project hibernate-orm by hibernate.
the class NativeSQLQueryPlanEqualsTest method testNativeSQLQuerySpecEquals.
@Test
public void testNativeSQLQuerySpecEquals() {
QueryPlanCache cache = new QueryPlanCache(sessionFactory());
NativeSQLQuerySpecification firstSpec = createSpec();
NativeSQLQuerySpecification secondSpec = createSpec();
NativeSQLQueryPlan firstPlan = cache.getNativeSQLQueryPlan(firstSpec);
NativeSQLQueryPlan secondPlan = cache.getNativeSQLQueryPlan(secondSpec);
assertEquals(firstPlan, secondPlan);
}
Aggregations