use of org.hibernate.hql.internal.ast.tree.DeleteStatement in project hibernate-orm by hibernate.
the class LocalTemporaryTableBulkIdStrategy method buildDeleteHandler.
@Override
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final DeleteStatement updateStatement = (DeleteStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
final IdTableInfoImpl tableInfo = getIdTableInfo(targetedPersister);
return new TableBasedDeleteHandlerImpl(factory, walker, tableInfo) {
@Override
protected void prepareForUse(Queryable persister, SharedSessionContractImplementor session) {
Helper.INSTANCE.createTempTable(tableInfo, ddlTransactionHandling, session);
}
@Override
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session) {
Helper.INSTANCE.releaseTempTable(tableInfo, afterUseAction, ddlTransactionHandling, session);
}
};
}
use of org.hibernate.hql.internal.ast.tree.DeleteStatement in project hibernate-orm by hibernate.
the class PersistentTableBulkIdStrategy method buildDeleteHandler.
@Override
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final DeleteStatement updateStatement = (DeleteStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
return new DeleteHandlerImpl(factory, walker, getIdTableInfo(targetedPersister));
}
use of org.hibernate.hql.internal.ast.tree.DeleteStatement in project hibernate-orm by hibernate.
the class GlobalTemporaryTableBulkIdStrategy method buildDeleteHandler.
@Override
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final DeleteStatement updateStatement = (DeleteStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
return new TableBasedDeleteHandlerImpl(factory, walker, getIdTableInfo(targetedPersister)) {
@Override
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session) {
if (afterUseAction == AfterUseAction.NONE) {
return;
}
// clean up our id-table rows
cleanUpRows(getIdTableInfo(persister).getQualifiedIdTableName(), session);
}
};
}
Aggregations