Package com.jeecms.cms.dao.main.impl

Source Code of com.jeecms.cms.dao.main.impl.CmsRoleDaoImpl

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

import java.util.List;

import org.springframework.stereotype.Repository;

import com.jeecms.cms.dao.main.CmsRoleDao;
import com.jeecms.cms.entity.main.CmsRole;
import com.jeecms.common.hibernate3.HibernateBaseDao;

@Repository
public class CmsRoleDaoImpl extends HibernateBaseDao<CmsRole, Integer>
    implements CmsRoleDao {
  @SuppressWarnings("unchecked")
  public List<CmsRole> getList() {
    String hql = "from CmsRole bean order by bean.priority asc";
    return find(hql);
  }

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

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

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

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

Related Classes of com.jeecms.cms.dao.main.impl.CmsRoleDaoImpl

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.