package quickstart;

/** */
@javax.annotation.Generated(value = { "Doma", "1.21.1" }, date = "2012-03-28T23:17:05.507+0900")
public class EmployeeDaoImpl extends org.seasar.doma.internal.jdbc.dao.AbstractDao implements quickstart.EmployeeDao {

    static {
        org.seasar.doma.internal.Artifact.validateVersion("1.21.1");
    }

    /**
     * @param config the config
     */
    public EmployeeDaoImpl(org.seasar.doma.jdbc.Config config) {
        super(config);
    }

    @Override
    public quickstart.Employee selectById(java.lang.Integer employeeId) {
        entering("quickstart.EmployeeDaoImpl", "selectById", employeeId);
        try {
            org.seasar.doma.internal.jdbc.query.SqlFileSelectQuery __query = new org.seasar.doma.internal.jdbc.query.SqlFileSelectQuery();
            __query.setConfig(config);
            __query.setSqlFilePath("META-INF/quickstart/EmployeeDao/selectById.sql");
            __query.addParameter("employeeId", java.lang.Integer.class, employeeId);
            __query.setCallerClassName("quickstart.EmployeeDaoImpl");
            __query.setCallerMethodName("selectById");
            __query.setResultEnsured(false);
            __query.setQueryTimeout(-1);
            __query.setMaxRows(-1);
            __query.setFetchSize(-1);
            __query.prepare();
            org.seasar.doma.internal.jdbc.command.SelectCommand<quickstart.Employee> __command = new org.seasar.doma.internal.jdbc.command.SelectCommand<quickstart.Employee>(__query, new org.seasar.doma.internal.jdbc.command.EntitySingleResultHandler<quickstart.Employee>(quickstart._Employee.getSingletonInternal()));
            quickstart.Employee __result = __command.execute();
            __query.complete();
            exiting("quickstart.EmployeeDaoImpl", "selectById", __result);
            return __result;
        } catch (java.lang.RuntimeException __e) {
            throwing("quickstart.EmployeeDaoImpl", "selectById", __e);
            throw __e;
        }
    }

    @Override
    public int update(quickstart.Employee employee) {
        entering("quickstart.EmployeeDaoImpl", "update", employee);
        try {
            if (employee == null) {
                throw new org.seasar.doma.DomaNullPointerException("employee");
            }
            org.seasar.doma.internal.jdbc.query.AutoUpdateQuery<quickstart.Employee> __query = new org.seasar.doma.internal.jdbc.query.AutoUpdateQuery<quickstart.Employee>(quickstart._Employee.getSingletonInternal());
            __query.setConfig(config);
            __query.setEntity(employee);
            __query.setCallerClassName("quickstart.EmployeeDaoImpl");
            __query.setCallerMethodName("update");
            __query.setQueryTimeout(-1);
            __query.setNullExcluded(false);
            __query.setVersionIncluded(false);
            __query.setVersionIgnored(false);
            __query.setIncludedPropertyNames();
            __query.setExcludedPropertyNames();
            __query.setUnchangedPropertyIncluded(false);
            __query.setOptimisticLockExceptionSuppressed(false);
            __query.prepare();
            org.seasar.doma.internal.jdbc.command.UpdateCommand __command = new org.seasar.doma.internal.jdbc.command.UpdateCommand(__query);
            int __result = __command.execute();
            __query.complete();
            exiting("quickstart.EmployeeDaoImpl", "update", __result);
            return __result;
        } catch (java.lang.RuntimeException __e) {
            throwing("quickstart.EmployeeDaoImpl", "update", __e);
            throw __e;
        }
    }

}
