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

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

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

import java.util.List;

import org.springframework.stereotype.Repository;

import com.jeecms.cms.dao.assist.CmsSensitivityDao;
import com.jeecms.cms.entity.assist.CmsSensitivity;
import com.jeecms.common.hibernate3.HibernateBaseDao;

@Repository
public class CmsSensitivityDaoImpl extends
    HibernateBaseDao<CmsSensitivity, Integer> implements CmsSensitivityDao {
  @SuppressWarnings("unchecked")
  public List<CmsSensitivity> getList(boolean cacheable) {
    String hql = "from CmsSensitivity bean order by bean.id desc";
    return getSession().createQuery(hql).setCacheable(cacheable).list();
  }

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

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

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

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

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

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.