GiftExchangeInfoService.java.svn-base 928 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
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();
	}

}