All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quhaodian.user.data.dao.impl.MenuDaoImpl Maven / Gradle / Ivy

There is a newer version: 1.8.31
Show newest version
package com.quhaodian.user.data.dao.impl;

import com.quhaodian.data.core.CatalogDaoImpl;
import com.quhaodian.user.data.dao.MenuDao;
import com.quhaodian.user.data.entity.Menu;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by imake on 2017年07月21日14:37:30.
 */
@Repository

public class MenuDaoImpl extends CatalogDaoImpl implements MenuDao {

  @Override
  public Menu findById(Integer id) {
    if (id == null) {
      return null;
    }
    return get(id);
  }

  @Override
  public Menu save(Menu bean) {

    add(bean);


    return bean;
  }

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

  @Override
  protected Class getEntityClass() {
    return Menu.class;
  }

  @Autowired
  public void setSuperSessionFactory(SessionFactory sessionFactory) {
    super.setSessionFactory(sessionFactory);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy