@Override public NativeSQLQueryPlan createQueryPlan( NativeSQLQuerySpecification specification, SessionFactoryImplementor sessionFactory) { CustomQuery customQuery = new SQLCustomQuery( specification.getQueryString(), specification.getQueryReturns(), specification.getQuerySpaces(), sessionFactory ); return new NativeSQLQueryPlan( specification.getQueryString(), customQuery ); } }
@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; }
public int performExecuteUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException { coordinateSharedCacheCleanup( session ); col += bindPositionalParameters( ps, queryParameters, col, session ); col += bindNamedParameters( ps, queryParameters .getNamedParameters(), col, session ); result = ps.executeUpdate();
@Override public ScrollableResultsImplementor scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { return scrollCustomQuery( getNativeQueryPlan( spec ).getCustomQuery(), queryParameters ); }
@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; }
SharedSessionContractImplementor session) throws HibernateException { coordinateSharedCacheCleanup( session );
String name = (String) e.getKey(); TypedValue typedval = (TypedValue) e.getValue(); int[] locs = getNamedParameterLocs( name ); for (int i = 0; i < locs.length; i++) { LOG.debugf("bindNamedParameters() %s -> %s [%s]", typedval.getValue(), name, locs[i] + start);
public int performExecuteUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException { coordinateSharedCacheCleanup( session ); col += bindPositionalParameters( ps, queryParameters, col, session ); col += bindNamedParameters( ps, queryParameters .getNamedParameters(), col, session ); result = ps.executeUpdate();
@Override public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { return listCustomQuery( getNativeQueryPlan( spec ).getCustomQuery(), queryParameters ); }
@Override public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters) throws HibernateException { errorIfClosed(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } temporaryPersistenceContext.clear(); return result; } }
String name = (String) e.getKey(); TypedValue typedval = (TypedValue) e.getValue(); int[] locs = getNamedParameterLocs( name ); for (int i = 0; i < locs.length; i++) { LOG.debugf("bindNamedParameters() %s -> %s [%s]", typedval.getValue(), name, locs[i] + start);
public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters) throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan( nativeQuerySpecification ); autoFlushIfRequired( plan.getCustomQuery().getQuerySpaces() ); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } return result; }
protected void coordinateSharedCacheCleanup(SharedSessionContractImplementor session) { final BulkOperationCleanupAction action = new BulkOperationCleanupAction( session, getCustomQuery().getQuerySpaces() ); if ( session.isEventSource() ) { ( (EventSource) session ).getActionQueue().addAction( action ); } else { action.getAfterTransactionCompletionProcess().doAfterTransactionCompletion( true, session ); } }
public NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec) { NativeSQLQueryPlan plan = ( NativeSQLQueryPlan ) planCache.get( spec ); if ( plan == null ) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Unable to locate native-sql query plan in cache; generating ({0})", spec.getQueryString() ); } plan = new NativeSQLQueryPlan( spec, factory ); } else { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Located native-sql query plan in cache ({0})", spec.getQueryString() ); } } planCache.put( spec, plan ); return plan; }
@Override public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters) throws HibernateException { errorIfClosed(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } temporaryPersistenceContext.clear(); return result; } }
public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters) throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan( nativeQuerySpecification ); autoFlushIfRequired( plan.getCustomQuery().getQuerySpaces() ); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } return result; }
@Override public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException { return listCustomQuery( getNativeSQLQueryPlan( spec ).getCustomQuery(), queryParameters ); }
public NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec) { NativeSQLQueryPlan plan = ( NativeSQLQueryPlan ) planCache.get( spec ); if ( plan == null ) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Unable to locate native-sql query plan in cache; generating ({0})", spec.getQueryString() ); } plan = new NativeSQLQueryPlan( spec, factory ); } else { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Located native-sql query plan in cache ({0})", spec.getQueryString() ); } } planCache.put( spec, plan ); return plan; }
@Override public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException { return listCustomQuery( getNativeSQLQueryPlan( spec ).getCustomQuery(), queryParameters ); }
@Override public ScrollableResults scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException { return scrollCustomQuery( getNativeSQLQueryPlan( spec ).getCustomQuery(), queryParameters ); }