package com.ifish.daoImpl;

import java.math.BigInteger;

import org.springframework.stereotype.Repository;

import com.ifish.dao.LiveRoomZanDao;
import com.ifish.entity.LiveRoomZan;
import com.ifish.entity.LiveRoomZanId;
import com.ifish.hibernate.HibernateBaseDao;

/**
 * 直播间点赞
 * @author Administrator
 *
 */
@Repository
public class LiveRoomZanDaoImpl extends HibernateBaseDao<LiveRoomZan, LiveRoomZanId> implements LiveRoomZanDao {

	@Override
	protected Class<LiveRoomZan> getEntityClass() {
		return LiveRoomZan.class;
	}

	@Override
	public Integer getZanNum(Integer roomId) {
		String sql = "select count(*) from tbl_live_room_zan where room_id=?";
		return ((BigInteger)getSession().createSQLQuery(sql).setInteger(0, roomId).uniqueResult()).intValue();
	}
	
}
