Steve Ebersole commented on Improvement HHH-7725

Here is the working first iteration:

/**
 * Generalized strategy contract for handling multi-table bulk HQL operations.
 *
 * @author Steve Ebersole
 */
public interface MultiTableBulkIdStrategy {
	/**
	 * Prepare the strategy.  Called as the SessionFactory is being built.  Intended patterns here include:<ul>
	 *     <li>Adding tables to the passed Mappings, to be picked by by "schema management tools"</li>
	 *     <li>Manually creating the tables immediately through the passed JDBC Connection access</li>
	 * </ul>
	 *
	 * @param dialect The dialect
	 * @param connectionAccess Access to the JDBC Connection
	 * @param mappings The Hibernate Mappings object
	 */
	public void prepare(Dialect dialect, JdbcConnectionAccess connectionAccess, Mappings mappings);

	/**
	 * Release the strategy.   Called as the SessionFactory is being shut down.
	 *
	 * @param dialect The dialect
	 * @param connectionAccess Access to the JDBC Connection
	 */
	public void release(Dialect dialect, JdbcConnectionAccess connectionAccess);

	/**
	 * Handler for dealing with multi-table HQL bulk update statements.
	 */
	public static interface UpdateHandler {
		public Queryable getTargetedQueryable();
		public String[] getSqlStatements();

		public int execute(SessionImplementor session, QueryParameters queryParameters);
	}

	/**
	 * Build a handler capable of handling the bulk update indicated by the given walker.
	 * 
	 * @param factory The SessionFactory
	 * @param walker The AST walker, representing the update query
	 * 
	 * @return The handler
	 */
	public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker);

	/**
	 * Handler for dealing with multi-table HQL bulk delete statements.
	 */
	public static interface DeleteHandler {
		public Queryable getTargetedQueryable();
		public String[] getSqlStatements();

		public int execute(SessionImplementor session, QueryParameters queryParameters);
	}

	/**
	 * Build a handler capable of handling the bulk delete indicated by the given walker.
	 *
	 * @param factory The SessionFactory
	 * @param walker The AST walker, representing the delete query
	 *
	 * @return The handler
	 */
	public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker);
}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira