32 lines
734 B
Java
32 lines
734 B
Java
package com.ifish.daoImpl;
|
|
|
|
import com.ifish.dao.CommentDao;
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
import com.ifish.entity.Comment;
|
|
import com.ifish.hibernate.HibernateBaseDao;
|
|
|
|
/**
|
|
* @ClassName: CommentDaoImpl
|
|
* @Description: TODO
|
|
* @author ggw
|
|
*
|
|
*/
|
|
|
|
@Repository()
|
|
public class CommentDaoImpl extends HibernateBaseDao<Comment, Integer> implements CommentDao {
|
|
|
|
@Override
|
|
protected Class<Comment> getEntityClass() {
|
|
return Comment.class;
|
|
}
|
|
|
|
@Override
|
|
public Integer getPinglunNum(Integer ueditorId) {
|
|
//查询评论数据
|
|
String sql = "SELECT count(*) FROM tbl_comment where ueditor_id=?";
|
|
return ((Number)getSession().createSQLQuery(sql).setInteger(0, ueditorId).uniqueResult()).intValue();
|
|
}
|
|
|
|
}
|