/* * Copyright 2004-2010 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package tutorial.dao; import java.sql.Timestamp; import java.util.List; import org.seasar.doma.BatchDelete; import org.seasar.doma.BatchInsert; import org.seasar.doma.BatchUpdate; import org.seasar.doma.Dao; import org.seasar.doma.Delegate; import org.seasar.doma.Delete; import org.seasar.doma.Insert; import org.seasar.doma.Select; import org.seasar.doma.Update; import org.seasar.doma.jdbc.IterationCallback; import org.seasar.doma.jdbc.SelectOptions; import tutorial.AppConfig; import tutorial.domain.Salary; import tutorial.entity.Employee; import tutorial.entity.EmployeeDepartment; @Dao(config = AppConfig.class) public interface EmployeeDao { @Select Employee selectById(Integer id); @Select List selectByAgeRange(Integer min, Integer max); @Select List selectByAges(List ages); @Select List selectByName(String name); @Select List selectByNames(List names); @Select List selectByNotEmptyName(String name); @Select List selectByNameWithPrefixMatching(String prefix); @Select List selectByNameWithSuffixMatching(String suffix); @Select List selectByNameWithInsideMatching(String inside); @Select List selectByHiredateRange(Timestamp from, Timestamp to); @Select List selectBySalary(Salary salary); @Select Salary selectSummedSalary(); @Select List selectByExample(Employee e); @Select List selectAll(); @Select List selectAll(SelectOptions options); @Select(iterate = true) R selectByAge(int age, IterationCallback callback); @Delegate(to = EmployeeDaoDelegate.class) int count(); @Select List selectAllEmployeeDepartment(); @Insert int insert(Employee employee); @Insert(sqlFile = true) int insertWithSqlFile(Employee employee); @Update int update(Employee employee); @Update(sqlFile = true) int updateWithSqlFile(Employee employee); @Delete int delete(Employee employee); @Delete(sqlFile = true) int deleteWithSqlFile(Employee employee); @BatchInsert int[] batchInsert(List employees); @BatchUpdate int[] batchUpdate(List employees); @BatchDelete int[] batchDelete(List employees); }