PrefectureService.java 850 Bytes
Newer Older
Kim Gyeongeun committed
1 2 3 4
package jp.agentec.sinaburocast.service;

import java.util.List;

5
import org.seasar.extension.jdbc.where.SimpleWhere;
Kim Gyeongeun committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;

import jp.agentec.sinaburocast.entity.Prefecture;

@Component(instance=InstanceType.SINGLETON)
public class PrefectureService extends AbstractService<Prefecture> {

    public Prefecture findById(Integer prefectureId) {
        return select().id(prefectureId).getSingleResult();
    }

    public List<Prefecture> findAllOrderById() {
        return select().orderBy("prefectureId asc").getResultList();
    }
21 22 23 24 25 26
    
    // IDで検索
 	public Prefecture findNameById(Integer prefectureId) {
 		return select().where(new SimpleWhere().eq("prefectureId",prefectureId )).getSingleResult();
 	}
 	
Kim Gyeongeun committed
27
}