Top Description Inners Fields Constructors Methods
org.hibernate.hql.spi.id

public abstract Class AbstractTableBasedBulkIdHandler

extends Object
Class Inheritance
Known Direct Subclasses
org.hibernate.hql.spi.id.TableBasedDeleteHandlerImpl, org.hibernate.hql.spi.id.TableBasedUpdateHandlerImpl, org.hibernate.hql.spi.id.AbstractIdsBulkIdHandler
Imports
java.util.ArrayList, .Collections, .List, java.util.function.Consumer, org.hibernate.HibernateException, org.hibernate.dialect.Dialect, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.hql.internal.ast.HqlSqlWalker, .SqlGenerator, org.hibernate.internal.util.StringHelper, org.hibernate.param.ParameterSpecification, org.hibernate.persister.collection.AbstractCollectionPersister, org.hibernate.persister.entity.Queryable, org.hibernate.sql.InsertSelect, .Select, .SelectValues, antlr.RecognitionException, antlr.collections.AST, org.hibernate.type.ComponentType, .Type

Convenience base class for MultiTableBulkIdStrategy.UpdateHandler and MultiTableBulkIdStrategy.DeleteHandler implementations through TableBasedUpdateHandlerImpl and TableBasedDeleteHandlerImpl respectively.

Mainly supports common activities like:

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final HqlSqlWalker

Constructor Summary

AccessConstructor and Description
public
AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, HqlSqlWalker walker)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
protected void
addAnyExtraIdSelectValues(SelectValues
The SelectValues that defines the select clause of the insert statement.
selectClause
)

Used from generateIdInsertSelect to allow subclasses to define any extra values to be selected (and therefore stored into the bulk-id table).

protected static void
appendJoined(String delimiter, String[] parts, StringBuilder sb)

protected SessionFactoryImplementor
factory()

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
protected String

Returns:

The INSERT-SELECT for populating the bulk-id table.
generateIdInsertSelect
(String
The table alias to use for the entity
tableAlias
,
IdTableInfo idTableInfo, AbstractTableBasedBulkIdHandler.ProcessedWhereClause
The processed representation for the user-defined WHERE clause.
whereClause
)

Generate the INSERT-SELECT statement for holding matching ids.

pack-priv Select
public static String
generateIdSelect(String tableAlias, String whereClause, Dialect dialect, Queryable queryable)

private static Select
generateIdSelect(String tableAlias, String whereClause, Dialect dialect, Queryable queryable, Consumer<SelectValues> addAnyExtraIdSelectValues)

protected String
generateIdSubselect(Queryable persister, IdTableInfo idTableInfo)

protected String
protected static String[]
public abstract Queryable
protected void
protected AbstractTableBasedBulkIdHandler.ProcessedWhereClause

Returns:

The bulk-id-ready WHERE clause representation
processWhereClause
(AST
The user-defined WHERE clause
whereClause
)

Interprets the WHERE clause from the user-defined update/delete query

protected void
protected HqlSqlWalker
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

walkerback to summary
private final HqlSqlWalker walker

Constructor Detail

AbstractTableBasedBulkIdHandlerback to summary
public AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, HqlSqlWalker walker)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

addAnyExtraIdSelectValuesback to summary
protected void addAnyExtraIdSelectValues(SelectValues selectClause)

Used from generateIdInsertSelect 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.

Parameters
selectClause:SelectValues

The SelectValues that defines the select clause of the insert statement.

appendJoinedback to summary
protected static void appendJoined(String delimiter, String[] parts, StringBuilder sb)
factoryback to summary
protected SessionFactoryImplementor factory()

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

generateIdInsertSelectback to summary
protected 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

Parameters
tableAlias:String

The table alias to use for the entity

whereClause:AbstractTableBasedBulkIdHandler.ProcessedWhereClause

The processed representation for the user-defined WHERE clause.

Returns:String

The INSERT-SELECT for populating the bulk-id table.

generateIdSelectback to summary
pack-priv Select generateIdSelect(String tableAlias, AbstractTableBasedBulkIdHandler.ProcessedWhereClause whereClause)
generateIdSelectback to summary
public static String generateIdSelect(String tableAlias, String whereClause, Dialect dialect, Queryable queryable)
generateIdSelectback to summary
private static Select generateIdSelect(String tableAlias, String whereClause, Dialect dialect, Queryable queryable, Consumer<SelectValues> addAnyExtraIdSelectValues)
generateIdSubselectback to summary
protected String generateIdSubselect(Queryable persister, IdTableInfo idTableInfo)
generateIdSubselectback to summary
protected String generateIdSubselect(Queryable persister, AbstractCollectionPersister cPersister, IdTableInfo idTableInfo)
getKeyColumnNamesback to summary
protected static String[] getKeyColumnNames(Queryable persister, AbstractCollectionPersister cPersister)
getTargetedQueryableback to summary
public abstract Queryable getTargetedQueryable()
prepareForUseback to summary
protected void prepareForUse(Queryable persister, SharedSessionContractImplementor session)
processWhereClauseback to summary
protected AbstractTableBasedBulkIdHandler.ProcessedWhereClause processWhereClause(AST whereClause)

Interprets the WHERE clause from the user-defined update/delete query

Parameters
whereClause:AST

The user-defined WHERE clause

Returns:AbstractTableBasedBulkIdHandler.ProcessedWhereClause

The bulk-id-ready WHERE clause representation

releaseFromUseback to summary
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session)
walkerback to summary
protected HqlSqlWalker walker()
org.hibernate.hql.spi.id back to summary

protected Class AbstractTableBasedBulkIdHandler.ProcessedWhereClause

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.spi.id.AbstractTableBasedBulkIdHandler.ProcessedWhereClause

Field Summary

Modifier and TypeField and Description
private final List<ParameterSpecification>
public static final AbstractTableBasedBulkIdHandler.ProcessedWhereClause
private final String

Constructor Summary

AccessConstructor and Description
private
public
ProcessedWhereClause(String userWhereClauseFragment, List<ParameterSpecification> idSelectParameterSpecifications)

Method Summary

Modifier and TypeMethod and Description
public List<ParameterSpecification>
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idSelectParameterSpecificationsback to summary
private final List<ParameterSpecification> idSelectParameterSpecifications
NO_WHERE_CLAUSEback to summary
public static final AbstractTableBasedBulkIdHandler.ProcessedWhereClause NO_WHERE_CLAUSE
userWhereClauseFragmentback to summary
private final String userWhereClauseFragment

Constructor Detail

ProcessedWhereClauseback to summary
private ProcessedWhereClause()
ProcessedWhereClauseback to summary
public ProcessedWhereClause(String userWhereClauseFragment, List<ParameterSpecification> idSelectParameterSpecifications)

Method Detail

getIdSelectParameterSpecificationsback to summary
public List<ParameterSpecification> getIdSelectParameterSpecifications()
getUserWhereClauseFragmentback to summary
public String getUserWhereClauseFragment()