public interface TransactionFactory {
/**
* Callback mechanism; a context is always a {@link org.hibernate.Session}
* in the Hibernate usage.
*/
public static interface Context {
public SessionFactoryImplementor getFactory();
public boolean isClosed();
public boolean isFlushModeNever();
public boolean isFlushBeforeCompletionEnabled();
public void managedFlush();
public boolean shouldAutoClose();
public void managedClose();
}
/**
* Begin a transaction and return the associated <tt>Transaction</tt> instance.
*
* @param jdbcContext The jdbc context to which the transaction belongs
* @param context The contract regarding the context in which this transaction will operate.
* @return Transaction
* @throws HibernateException Indicates a problem generating a transaction instance
*/
public Transaction createTransaction(JDBCContext jdbcContext, Context context) throws HibernateException;
..........
接口里弄个接口,这样做是啥目的呢??外国人写代码就不一样