Steve Ebersole commented on Improvement HHH-7725

Here is a preliminary attempt at the delegate contract:

import org.hibernate.cfg.Mappings;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.jdbc.spi.JdbcConnectionAccess;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.param.ParameterSpecification;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.sql.Delete;
import org.hibernate.sql.Select;
import org.hibernate.sql.Update;

public interface IdTableSupport {
	public void prepare(Dialect dialect, JdbcConnectionAccess connectionAccess, Mappings mappings);
	public void release(Dialect dialect, JdbcConnectionAccess connectionAccess, Mappings mappings);

	public void prepareForUse(EntityPersister persister, SessionImplementor session);
	public void releaseFromUse(EntityPersister persister, SessionImplementor session);

	// still need calls to (1) "store" ids, (2) prepare update/delete with stored id data
	// rough first cut...

	public StoredIds storeIds(
			EntityPersister persister, 
			Select idSelect, 
			Iterable<ParameterSpecification> parameterSpecifications, 
			SessionImplementor session);

	public Delete buildDelete(String table, String[] columnNames, StoredIds storedIds);
	public Update buildUpdate(String table, String[] columnNames, StoredIds storedIds);
	
	public static interface StoredIds {
		public int getCount();
	}
}

Thoughts?

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