@Override public String[] getSqlStatements() { return delegate.getSqlStatements(); } }
@Override public Queryable getTargetedQueryable() { return delegate.getTargetedQueryable(); }
String[] updates = delegate.getSqlStatements(); UpdateStatement updateStatement = (UpdateStatement) walker.getAST(); FromElement fromElement = updateStatement.getFromClause().getFromElement(); String[][] columnNames = targetedPersister.getContraintOrderedTableKeyColumnClosure(); int subclassCount = delegate.getTargetedQueryable().getEntityMetamodel().getSubclassEntityNames().size(); Set<String> subclassTableNames = new HashSet<>(); for (int i = 0; i < subclassCount; i++) { subclassTableNames.add(delegate.getTargetedQueryable().getSubclassTableName(i));
@Override public int execute(final SessionImplementor session, QueryParameters queryParameters) { TransactionCoordinator transactionCoordinator = session.getTransactionCoordinator(); final JdbcCoordinator jdbcCoordinator = transactionCoordinator.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; } } })); Object transactionCoordinatorProxy = Proxy.newProxyInstance(transactionCoordinator.getClass().getClassLoader(), new Class[]{ TransactionCoordinator.class }, new Hibernate43TransactionCoordinatorInvocationHandler(transactionCoordinator, jdbcCoordinatorProxy)); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{ SessionImplementor.class, EventSource.class }, new Hibernate43SessionInvocationHandler(session, transactionCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
String[] updates = delegate.getSqlStatements(); UpdateStatement updateStatement = (UpdateStatement) walker.getAST(); FromElement fromElement = updateStatement.getFromClause().getFromElement(); String[][] columnNames = targetedPersister.getContraintOrderedTableKeyColumnClosure(); int subclassCount = delegate.getTargetedQueryable().getEntityMetamodel().getSubclassEntityNames().size(); Set<String> subclassTableNames = new HashSet<>(); for (int i = 0; i < subclassCount; i++) { subclassTableNames.add(delegate.getTargetedQueryable().getSubclassTableName(i));
@Override public int execute(final SessionImplementor session, QueryParameters queryParameters) { TransactionCoordinator transactionCoordinator = session.getTransactionCoordinator(); final JdbcCoordinator jdbcCoordinator = transactionCoordinator.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; } } })); Object transactionCoordinatorProxy = Proxy.newProxyInstance(transactionCoordinator.getClass().getClassLoader(), new Class[]{ TransactionCoordinator.class }, new Hibernate43TransactionCoordinatorInvocationHandler(transactionCoordinator, jdbcCoordinatorProxy)); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{ SessionImplementor.class, EventSource.class }, new Hibernate43SessionInvocationHandler(session, transactionCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
String[] updates = delegate.getSqlStatements(); UpdateStatement updateStatement = (UpdateStatement) walker.getAST(); FromElement fromElement = updateStatement.getFromClause().getFromElement(); String[][] columnNames = targetedPersister.getContraintOrderedTableKeyColumnClosure(); int subclassCount = delegate.getTargetedQueryable().getEntityMetamodel().getSubclassEntityNames().size(); Set<String> subclassTableNames = new HashSet<>(); for (int i = 0; i < subclassCount; i++) { subclassTableNames.add(delegate.getTargetedQueryable().getSubclassTableName(i));
@Override public String[] getSqlStatements() { return delegate.getSqlStatements(); } }
@Override public Queryable getTargetedQueryable() { return delegate.getTargetedQueryable(); }
@Override public int execute(final SessionImplementor session, QueryParameters queryParameters) { TransactionCoordinator transactionCoordinator = session.getTransactionCoordinator(); final JdbcCoordinator jdbcCoordinator = transactionCoordinator.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; } } })); Object transactionCoordinatorProxy = Proxy.newProxyInstance(transactionCoordinator.getClass().getClassLoader(), new Class[]{ TransactionCoordinator.class }, new Hibernate4TransactionCoordinatorInvocationHandler(transactionCoordinator, jdbcCoordinatorProxy)); SessionImplementor sessionProxy = (SessionImplementor) Proxy.newProxyInstance(session.getClass().getClassLoader(), new Class[]{SessionImplementor.class, EventSource.class}, new Hibernate4SessionInvocationHandler(session, transactionCoordinatorProxy)); return delegate.execute(sessionProxy, queryParameters); }
@Override public String[] getSqlStatements() { return delegate.getSqlStatements(); } }
@Override public Queryable getTargetedQueryable() { return delegate.getTargetedQueryable(); }