001    
002    /*
003     * Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
004     *
005     * $Id: DatabaseAction.java 209 2012-01-12 15:52:06Z archie.cobbs $
006     */
007    
008    package org.dellroad.stuff.schema;
009    
010    /**
011     * Database action interface.
012     *
013     * @param <T> database transaction type
014     */
015    public interface DatabaseAction<T> {
016    
017        /**
018         * Apply this action to the database using the provided open transaction.
019         *
020         * @param transaction open transaction
021         * @throws Exception if the action fails
022         */
023        void apply(T transaction) throws Exception;
024    }
025