01: package org.hibernate.id.insert;
02:
03: import org.hibernate.engine.SessionImplementor;
04:
05: import java.io.Serializable;
06: import java.sql.PreparedStatement;
07: import java.sql.SQLException;
08:
09: /**
10: * Responsible for handling delegation relating to variants in how
11: * insert-generated-identifier generator strategies dictate processing:<ul>
12: * <li>building the sql insert statement
13: * <li>determination of the generated identifier value
14: * </ul>
15: *
16: * @author Steve Ebersole
17: */
18: public interface InsertGeneratedIdentifierDelegate {
19:
20: /**
21: * Build a {@link org.hibernate.sql.Insert} specific to the delegate's mode
22: * of handling generated key values.
23: *
24: * @return The insert object.
25: */
26: public IdentifierGeneratingInsert prepareIdentifierGeneratingInsert();
27:
28: /**
29: * Perform the indicated insert SQL statement and determine the identifier value
30: * generated.
31: *
32: * @param insertSQL
33: * @param session
34: * @param binder
35: * @return The generated identifier value.
36: */
37: public Serializable performInsert(String insertSQL,
38: SessionImplementor session, Binder binder);
39:
40: }
|