package jp.agentec.sinaburocast.service; import jp.agentec.sinaburocast.entity.AdminUser; import jp.agentec.sinaburocast.entity.GiftExchangeInfo; import org.seasar.extension.jdbc.where.SimpleWhere; import org.seasar.framework.container.annotation.tiger.Component; import org.seasar.framework.container.annotation.tiger.InstanceType; @Component(instance=InstanceType.SINGLETON) public class GiftExchangeInfoService extends AbstractService<GiftExchangeInfo> { private static final String ID_SEQ_NAME = "gift_exchange_info_id_seq"; /** * IDを発行して、登録する。 * */ public int insertGiftExchangeInfo(GiftExchangeInfo giftExchangeInfo, AdminUser adminUserInfo) { giftExchangeInfo.giftExchangeInfoId = getSeqNextVal(Integer.class, ID_SEQ_NAME); return super.insert(giftExchangeInfo, adminUserInfo.loginId); } public GiftExchangeInfo findGiftExchangeInfo() { return select().getSingleResult(); } }