TemplateService.java.svn-base 831 Bytes
Newer Older
Kim Gyeongeun committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package jp.agentec.sinaburocast.service;

import java.util.List;

import org.seasar.extension.jdbc.where.SimpleWhere;
import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;

import jp.agentec.sinaburocast.entity.Template;

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

	
	
    public Template findById(Integer templateId) {
        return select().id(templateId).getSingleResult();
    }

    public List<Template> findAllOrderById() {
        return select().orderBy("template_id asc").getResultList();
    }
    
    
    public Template findByenqueteType(Integer enqueteType) {
        return select().where(new SimpleWhere().eq("enqueteType", enqueteType)).getSingleResult();
    }
}