${database.allClassCopyright}package ${glPackageBaseCommonAp};

import javax.sql.DataSource;

import org.seasar.dbflute.BehaviorSelector;
import org.seasar.dbflute.bhv.core.BehaviorCommandInvoker;
import org.seasar.dbflute.bhv.core.CommonColumnAutoSetupper;
import ${glPackageBaseCommonLib}.${glDBFluteModuleLib};
import ${glPackageExtendedBhvAp}.*;

/**
 * @author ${database.classAuthor}
 */
public class ${glDBFluteModuleAp} extends ${glDBFluteModuleLib} {

    public ${glDBFluteModuleAp}(DataSource dataSource) {
        super(dataSource);
    }

    @Override
    protected void setupBehavior(BehaviorCommandInvoker ker, BehaviorSelector tor, CommonColumnAutoSetupper per) {
        super.setupBehavior(ker, tor, per);

#foreach ($table in $database.tables)
        {
            ${table.extendedBehaviorApClassName} bhv = new ${table.extendedBehaviorApClassName}();
#if ($table.isWritable())
            bhv.setBehaviorCommandInvoker(ker); bhv.setBehaviorSelector(tor); bhv.setCommonColumnAutoSetupper(per);
#else
            bhv.setBehaviorCommandInvoker(ker); bhv.setBehaviorSelector(tor);
#end
            bind(${table.extendedBehaviorApClassName}.class).toInstance(bhv);
        }
#end
    }
}
