Package com.jeecms.cms.dao.assist.impl

Source Code of com.jeecms.cms.dao.assist.impl.CmsVoteItemDaoImpl

package com.jeecms.cms.dao.assist.impl;

import org.hibernate.Criteria;
import org.springframework.stereotype.Repository;

import com.jeecms.cms.dao.assist.CmsVoteItemDao;
import com.jeecms.cms.entity.assist.CmsVoteItem;
import com.jeecms.common.hibernate3.HibernateBaseDao;
import com.jeecms.common.page.Pagination;

@Repository
public class CmsVoteItemDaoImpl extends HibernateBaseDao<CmsVoteItem, Integer>
    implements CmsVoteItemDao {
  public Pagination getPage(int pageNo, int pageSize) {
    Criteria crit = createCriteria();
    Pagination page = findByCriteria(crit, pageNo, pageSize);
    return page;
  }

  public CmsVoteItem findById(Integer id) {
    CmsVoteItem entity = get(id);
    return entity;
  }

  public CmsVoteItem save(CmsVoteItem bean) {
    getSession().save(bean);
    return bean;
  }

  public CmsVoteItem deleteById(Integer id) {
    CmsVoteItem entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }

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

Related Classes of com.jeecms.cms.dao.assist.impl.CmsVoteItemDaoImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.