HHH-7725 - Make handling multi-table bulk HQL operations more pluggable

This commit is contained in:
Steve Ebersole 2012-10-31 12:41:48 -05:00
parent 0ab36bed8c
commit 1b5088a911
4 changed files with 22 additions and 10 deletions

View File

@ -55,10 +55,6 @@ public class AbstractTableBasedBulkIdHandler {
private final String catalog;
private final String schema;
public AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, HqlSqlWalker walker) {
this( sessionFactory, walker, null, null );
}
public AbstractTableBasedBulkIdHandler(
SessionFactoryImplementor sessionFactory,
HqlSqlWalker walker,

View File

@ -217,7 +217,7 @@ public class PersistentTableBulkIdStrategy implements MultiTableBulkIdStrategy {
@Override
public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
return new TableBasedUpdateHandlerImpl( factory, walker ) {
return new TableBasedUpdateHandlerImpl( factory, walker, catalog, schema ) {
@Override
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
selectClause.addParameter( Types.CHAR, 36 );
@ -285,7 +285,7 @@ public class PersistentTableBulkIdStrategy implements MultiTableBulkIdStrategy {
@Override
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
return new TableBasedDeleteHandlerImpl( factory, walker ) {
return new TableBasedDeleteHandlerImpl( factory, walker, catalog, schema ) {
@Override
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
selectClause.addParameter( Types.CHAR, 36 );

View File

@ -54,8 +54,16 @@ public class TableBasedDeleteHandlerImpl
private final List<ParameterSpecification> idSelectParameterSpecifications;
private final String[] deletes;
TableBasedDeleteHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
super( factory, walker );
public TableBasedDeleteHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
this( factory, walker, null, null );
}
public TableBasedDeleteHandlerImpl(
SessionFactoryImplementor factory,
HqlSqlWalker walker,
String catalog,
String schema) {
super( factory, walker, catalog, schema );
DeleteStatement deleteStatement = ( DeleteStatement ) walker.getAST();
FromElement fromElement = deleteStatement.getFromClause().getFromElement();

View File

@ -60,8 +60,16 @@ public class TableBasedUpdateHandlerImpl
private final ParameterSpecification[][] assignmentParameterSpecifications;
@SuppressWarnings("unchecked")
TableBasedUpdateHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
super( factory, walker );
public TableBasedUpdateHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
this( factory, walker, null, null );
}
public TableBasedUpdateHandlerImpl(
SessionFactoryImplementor factory,
HqlSqlWalker walker,
String catalog,
String schema) {
super( factory, walker, catalog, schema );
UpdateStatement updateStatement = ( UpdateStatement ) walker.getAST();
FromElement fromElement = updateStatement.getFromClause().getFromElement();