HHH-7725 - Make handling multi-table bulk HQL operations more pluggable
(cherry picked from commit 1b5088a911
)
This commit is contained in:
parent
87fe888ad5
commit
cac22a3926
|
@ -55,10 +55,6 @@ public class AbstractTableBasedBulkIdHandler {
|
||||||
private final String catalog;
|
private final String catalog;
|
||||||
private final String schema;
|
private final String schema;
|
||||||
|
|
||||||
public AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, HqlSqlWalker walker) {
|
|
||||||
this( sessionFactory, walker, null, null );
|
|
||||||
}
|
|
||||||
|
|
||||||
public AbstractTableBasedBulkIdHandler(
|
public AbstractTableBasedBulkIdHandler(
|
||||||
SessionFactoryImplementor sessionFactory,
|
SessionFactoryImplementor sessionFactory,
|
||||||
HqlSqlWalker walker,
|
HqlSqlWalker walker,
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class PersistentTableBulkIdStrategy implements MultiTableBulkIdStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
||||||
return new TableBasedUpdateHandlerImpl( factory, walker ) {
|
return new TableBasedUpdateHandlerImpl( factory, walker, catalog, schema ) {
|
||||||
@Override
|
@Override
|
||||||
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
|
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
|
||||||
selectClause.addParameter( Types.CHAR, 36 );
|
selectClause.addParameter( Types.CHAR, 36 );
|
||||||
|
@ -285,7 +285,7 @@ public class PersistentTableBulkIdStrategy implements MultiTableBulkIdStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
||||||
return new TableBasedDeleteHandlerImpl( factory, walker ) {
|
return new TableBasedDeleteHandlerImpl( factory, walker, catalog, schema ) {
|
||||||
@Override
|
@Override
|
||||||
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
|
protected void addAnyExtraIdSelectValues(SelectValues selectClause) {
|
||||||
selectClause.addParameter( Types.CHAR, 36 );
|
selectClause.addParameter( Types.CHAR, 36 );
|
||||||
|
|
|
@ -54,8 +54,16 @@ public class TableBasedDeleteHandlerImpl
|
||||||
private final List<ParameterSpecification> idSelectParameterSpecifications;
|
private final List<ParameterSpecification> idSelectParameterSpecifications;
|
||||||
private final String[] deletes;
|
private final String[] deletes;
|
||||||
|
|
||||||
TableBasedDeleteHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
public TableBasedDeleteHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
||||||
super( factory, 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();
|
DeleteStatement deleteStatement = ( DeleteStatement ) walker.getAST();
|
||||||
FromElement fromElement = deleteStatement.getFromClause().getFromElement();
|
FromElement fromElement = deleteStatement.getFromClause().getFromElement();
|
||||||
|
|
|
@ -60,8 +60,16 @@ public class TableBasedUpdateHandlerImpl
|
||||||
private final ParameterSpecification[][] assignmentParameterSpecifications;
|
private final ParameterSpecification[][] assignmentParameterSpecifications;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
TableBasedUpdateHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
public TableBasedUpdateHandlerImpl(SessionFactoryImplementor factory, HqlSqlWalker walker) {
|
||||||
super( factory, 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();
|
UpdateStatement updateStatement = ( UpdateStatement ) walker.getAST();
|
||||||
FromElement fromElement = updateStatement.getFromClause().getFromElement();
|
FromElement fromElement = updateStatement.getFromClause().getFromElement();
|
||||||
|
|
Loading…
Reference in New Issue