@Override public int execute(final SessionImplementor session, QueryParameters queryParameters) { final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate5SessionInvocationHandler(session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public int execute(SharedSessionContractImplementor s, QueryParameters queryParameters) { final SessionImplementor session = (SessionImplementor) s; final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate53SessionInvocationHandler(session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public int execute(SharedSessionContractImplementor s, QueryParameters queryParameters) { final SessionImplementor session = (SessionImplementor) s; final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate53SessionInvocationHandler(session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public int execute(final SessionImplementor session, QueryParameters queryParameters) { final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate5SessionInvocationHandler(session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public int execute(SharedSessionContractImplementor s, QueryParameters queryParameters) { final SessionImplementor session = (SessionImplementor) s; final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate52SessionInvocationHandler((SessionImplementor) session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public int execute(SharedSessionContractImplementor s, QueryParameters queryParameters) { final SessionImplementor session = (SessionImplementor) s; final JdbcCoordinator jdbcCoordinator = session.getJdbcCoordinator(); Object jdbcCoordinatorProxy = Proxy.newProxyInstance(jdbcCoordinator.getClass().getClassLoader(), new Class[]{JdbcCoordinator.class}, new JdbcCoordinatorInvocationHandler(jdbcCoordinator, new DelegatingStatementPreparerImpl(jdbcCoordinator.getStatementPreparer()) { PreparedStatement statementProxy; SecondaryTableUpdateSupportingPreparedStatementInvocationHandler invocationHandler; @Override public PreparedStatement prepareStatement(String sql, boolean isCallable) { if (sql.isEmpty()) { // Return the statement proxy which collects parameters and then executes update/insert statements for secondary tables invocationHandler.prepareNext(); return statementProxy; } else { PreparedStatement insertStatement = super.prepareStatement(sql, isCallable); this.invocationHandler = new SecondaryTableUpdateSupportingPreparedStatementInvocationHandler(session, jdbcCoordinator.getStatementPreparer(), insertStatement, secondaryTableUpdates, secondaryTableInserts); this.statementProxy = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class}, invocationHandler); return statementProxy; } } })); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate52SessionInvocationHandler((SessionImplementor) session, jdbcCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }