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

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

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

import java.util.List;

import org.springframework.stereotype.Repository;

import com.jeecms.cms.dao.assist.CmsAdvertisingSpaceDao;
import com.jeecms.cms.entity.assist.CmsAdvertisingSpace;
import com.jeecms.common.hibernate3.Finder;
import com.jeecms.common.hibernate3.HibernateBaseDao;

@Repository
public class CmsAdvertisingSpaceDaoImpl extends
    HibernateBaseDao<CmsAdvertisingSpace, Integer> implements
    CmsAdvertisingSpaceDao {
  @SuppressWarnings("unchecked")
  public List<CmsAdvertisingSpace> getList(Integer siteId) {
    Finder f = Finder.create("from CmsAdvertisingSpace bean");
    if (siteId != null) {
      f.append(" where bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    return find(f);
  }

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

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

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

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

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

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.