@Override public int executeUpdate() { if ( ! getProducer().isTransactionInProgress() ) { throw new TransactionRequiredException( "javax.persistence.Query.executeUpdate requires active transaction" ); } // the expectation is that there is just one Output, of type UpdateCountOutput try { execute(); return getUpdateCount(); } finally { outputs().release(); } }
private boolean shouldFlush() { if ( getProducer().isTransactionInProgress() ) { FlushMode effectiveFlushMode = getHibernateFlushMode(); if ( effectiveFlushMode == null ) { effectiveFlushMode = getProducer().getHibernateFlushMode(); } if ( effectiveFlushMode == FlushMode.ALWAYS ) { return true; } if ( effectiveFlushMode == FlushMode.AUTO ) { if ( getProducer().getFactory().getSessionFactoryOptions().isJpaBootstrap() ) { return true; } } } return false; }
@Override public int executeUpdate() throws HibernateException { if ( ! getProducer().isTransactionInProgress() ) { throw getProducer().getExceptionConverter().convert( new TransactionRequiredException(
@SuppressWarnings("unchecked") protected List<R> doList() { if ( getMaxResults() == 0 ) { return Collections.EMPTY_LIST; } if ( lockOptions.getLockMode() != null && lockOptions.getLockMode() != LockMode.NONE ) { if ( !getProducer().isTransactionInProgress() ) { throw new TransactionRequiredException( "no transaction is in progress" ); } } final String expandedQuery = getQueryParameterBindings().expandListValuedParameters( getQueryString(), getProducer() ); return getProducer().list( expandedQuery, makeQueryParametersForExecution( expandedQuery ) ); }
@Override protected int doExecuteUpdate() { if ( ! getSession().isTransactionInProgress() ) { throw new TransactionRequiredException( "javax.persistence.Query.executeUpdate requires active transaction" ); } // the expectation is that there is just one Output, of type UpdateCountOutput try { execute(); return getUpdateCount(); } finally { outputs().release(); } }
private boolean shouldFlush() { if ( getSession().isTransactionInProgress() ) { FlushMode effectiveFlushMode = getHibernateFlushMode(); if ( effectiveFlushMode == null ) { effectiveFlushMode = getSession().getHibernateFlushMode(); } if ( effectiveFlushMode == FlushMode.ALWAYS ) { return true; } if ( effectiveFlushMode == FlushMode.AUTO ) { if ( getSession().getFactory().getSessionFactoryOptions().isJpaBootstrap() ) { return true; } } } return false; }
@Override public int executeUpdate() throws HibernateException { if ( !getSession().isTransactionInProgress() ) { throw getSession().getExceptionConverter().convert( new TransactionRequiredException(