com.quhaodian.notice.data.dao.impl.UserMessageSubjectDaoImpl Maven / Gradle / Ivy
package com.quhaodian.notice.data.dao.impl;
import com.quhaodian.data.core.CriteriaDaoImpl;
import com.quhaodian.notice.data.dao.UserMessageSubjectDao;
import com.quhaodian.notice.data.entity.UserMessageSubject;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
/**
* Created by imake on 2018年01月02日11:12:13.
*/
@Repository
public class UserMessageSubjectDaoImpl extends CriteriaDaoImpl implements UserMessageSubjectDao {
@Override
public UserMessageSubject findById(Long id) {
if (id == null) {
return null;
}
return get(id);
}
@Override
public UserMessageSubject save(UserMessageSubject bean) {
getSession().save(bean);
return bean;
}
@Override
public UserMessageSubject deleteById(Long id) {
UserMessageSubject entity = super.get(id);
if (entity != null) {
getSession().delete(entity);
}
return entity;
}
@Override
protected Class getEntityClass() {
return UserMessageSubject.class;
}
@Autowired
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
}