public abstract class AbstractTableBasedBulkIdHandler extends Object
Convenience base class for MultiTableBulkIdStrategy.UpdateHandler
and MultiTableBulkIdStrategy.DeleteHandler implementations through
TableBasedUpdateHandlerImpl and TableBasedDeleteHandlerImpl respectively.
<p/>
Mainly supports common activities like:<ul>
<li>processing the original WHERE clause (if one) - processWhereClause(antlr.collections.AST)</li>
<li>generating the proper SELECT clause for the id-table insert - generateIdInsertSelect(java.lang.String, org.hibernate.hql.spi.id.IdTableInfo, org.hibernate.hql.spi.id.AbstractTableBasedBulkIdHandler.ProcessedWhereClause)</li>
<li>generating the sub-select from the id-table - generateIdSubselect(org.hibernate.persister.entity.Queryable, org.hibernate.hql.spi.id.IdTableInfo)</li>
</ul>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractTableBasedBulkIdHandler.ProcessedWhereClause |
| Constructor and Description |
|---|
AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory,
org.hibernate.hql.internal.ast.HqlSqlWalker walker) |
public AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
protected SessionFactoryImplementor factory()
protected org.hibernate.hql.internal.ast.HqlSqlWalker walker()
public abstract Queryable getTargetedQueryable()
protected AbstractTableBasedBulkIdHandler.ProcessedWhereClause processWhereClause(antlr.collections.AST whereClause)
Interprets the WHERE clause from the user-defined update/delete query
whereClause - The user-defined WHERE clauseWHERE clause representationprotected String generateIdInsertSelect(String tableAlias, IdTableInfo idTableInfo, AbstractTableBasedBulkIdHandler.ProcessedWhereClause whereClause)
Generate the INSERT-SELECT statement for holding matching ids. This is the
INSERT used to populate the bulk-id table with ids matching the restrictions defined in the
original WHERE clause
tableAlias - The table alias to use for the entitywhereClause - The processed representation for the user-defined WHERE clause.INSERT-SELECT for populating the bulk-id table.protected Select generateIdSelect(String tableAlias, AbstractTableBasedBulkIdHandler.ProcessedWhereClause whereClause)
protected void addAnyExtraIdSelectValues(SelectValues selectClause)
Used from generateIdInsertSelect(java.lang.String, org.hibernate.hql.spi.id.IdTableInfo, org.hibernate.hql.spi.id.AbstractTableBasedBulkIdHandler.ProcessedWhereClause) to allow subclasses to define any extra
values to be selected (and therefore stored into the bulk-id table). Used to store
session identifier, e.g.
selectClause - The SelectValues that defines the select clause of the insert statement.protected String generateIdSubselect(Queryable persister, IdTableInfo idTableInfo)
protected void prepareForUse(Queryable persister, SharedSessionContractImplementor session)
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.