Package org.hibernate.hql.spi.id
Class AbstractTableBasedBulkIdHandler
- java.lang.Object
-
- org.hibernate.hql.spi.id.AbstractTableBasedBulkIdHandler
-
- Direct Known Subclasses:
AbstractIdsBulkIdHandler,TableBasedDeleteHandlerImpl,TableBasedUpdateHandlerImpl
public abstract class AbstractTableBasedBulkIdHandler extends java.lang.ObjectConvenience base class forMultiTableBulkIdStrategy.UpdateHandlerandMultiTableBulkIdStrategy.DeleteHandlerimplementations throughTableBasedUpdateHandlerImplandTableBasedDeleteHandlerImplrespectively. Mainly supports common activities like:- processing the original
WHEREclause (if one) -processWhereClause(antlr.collections.AST) - generating the proper
SELECTclause for the id-table insert -generateIdInsertSelect(java.lang.String, org.hibernate.hql.spi.id.IdTableInfo, org.hibernate.hql.spi.id.AbstractTableBasedBulkIdHandler.ProcessedWhereClause) - generating the sub-select from the id-table -
generateIdSubselect(org.hibernate.persister.entity.Queryable, org.hibernate.hql.spi.id.IdTableInfo)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractTableBasedBulkIdHandler.ProcessedWhereClause
-
Constructor Summary
Constructors Constructor Description AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddAnyExtraIdSelectValues(SelectValues selectClause)Used fromgenerateIdInsertSelect(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).protected static voidappendJoined(java.lang.String delimiter, java.lang.String[] parts, java.lang.StringBuilder sb)protected SessionFactoryImplementorfactory()protected java.lang.StringgenerateIdInsertSelect(java.lang.String tableAlias, IdTableInfo idTableInfo, AbstractTableBasedBulkIdHandler.ProcessedWhereClause whereClause)Generate theINSERT-SELECTstatement for holding matching ids.static java.lang.StringgenerateIdSelect(java.lang.String tableAlias, java.lang.String whereClause, Dialect dialect, Queryable queryable)protected java.lang.StringgenerateIdSubselect(Queryable persister, IdTableInfo idTableInfo)protected java.lang.StringgenerateIdSubselect(Queryable persister, AbstractCollectionPersister cPersister, IdTableInfo idTableInfo)protected static java.lang.String[]getKeyColumnNames(Queryable persister, AbstractCollectionPersister cPersister)abstract QueryablegetTargetedQueryable()protected voidprepareForUse(Queryable persister, SharedSessionContractImplementor session)protected AbstractTableBasedBulkIdHandler.ProcessedWhereClauseprocessWhereClause(antlr.collections.AST whereClause)Interprets theWHEREclause from the user-defined update/delete queryprotected voidreleaseFromUse(Queryable persister, SharedSessionContractImplementor session)protected org.hibernate.hql.internal.ast.HqlSqlWalkerwalker()
-
-
-
Constructor Detail
-
AbstractTableBasedBulkIdHandler
public AbstractTableBasedBulkIdHandler(SessionFactoryImplementor sessionFactory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
-
-
Method Detail
-
factory
protected SessionFactoryImplementor factory()
-
walker
protected org.hibernate.hql.internal.ast.HqlSqlWalker walker()
-
getTargetedQueryable
public abstract Queryable getTargetedQueryable()
-
processWhereClause
protected AbstractTableBasedBulkIdHandler.ProcessedWhereClause processWhereClause(antlr.collections.AST whereClause)
Interprets theWHEREclause from the user-defined update/delete query- Parameters:
whereClause- The user-definedWHEREclause- Returns:
- The bulk-id-ready
WHEREclause representation
-
generateIdInsertSelect
protected java.lang.String generateIdInsertSelect(java.lang.String tableAlias, IdTableInfo idTableInfo, AbstractTableBasedBulkIdHandler.ProcessedWhereClause whereClause)Generate theINSERT-SELECTstatement for holding matching ids. This is theINSERTused to populate the bulk-id table with ids matching the restrictions defined in the originalWHEREclause- Parameters:
tableAlias- The table alias to use for the entitywhereClause- The processed representation for the user-definedWHEREclause.- Returns:
- The
INSERT-SELECTfor populating the bulk-id table.
-
generateIdSelect
public static java.lang.String generateIdSelect(java.lang.String tableAlias, java.lang.String whereClause, Dialect dialect, Queryable queryable)
-
addAnyExtraIdSelectValues
protected void addAnyExtraIdSelectValues(SelectValues selectClause)
Used fromgenerateIdInsertSelect(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.- Parameters:
selectClause- The SelectValues that defines the select clause of the insert statement.
-
generateIdSubselect
protected java.lang.String generateIdSubselect(Queryable persister, IdTableInfo idTableInfo)
-
generateIdSubselect
protected java.lang.String generateIdSubselect(Queryable persister, AbstractCollectionPersister cPersister, IdTableInfo idTableInfo)
-
getKeyColumnNames
protected static java.lang.String[] getKeyColumnNames(Queryable persister, AbstractCollectionPersister cPersister)
-
appendJoined
protected static void appendJoined(java.lang.String delimiter, java.lang.String[] parts, java.lang.StringBuilder sb)
-
prepareForUse
protected void prepareForUse(Queryable persister, SharedSessionContractImplementor session)
-
releaseFromUse
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session)
-
-