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

com.haoxuer.discover.article.data.dao.impl.ArticleDocumentDaoImpl Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.article.data.dao.impl;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.haoxuer.discover.data.core.CriteriaDaoImpl;
import com.haoxuer.discover.article.data.dao.ArticleDocumentDao;
import com.haoxuer.discover.article.data.entity.ArticleDocument;

/**
* Created by imake on 2020年11月27日19:35:47.
*/
@Repository

public class ArticleDocumentDaoImpl extends CriteriaDaoImpl implements ArticleDocumentDao {

	@Override
	public ArticleDocument findById(Long id) {
	    if (id==null) {
			return null;
		}
		return get(id);
	}

	@Override
	public ArticleDocument save(ArticleDocument bean) {

        getSession().save(bean);
		
		
		return bean;
	}

    @Override
	public ArticleDocument deleteById(Long id) {
		ArticleDocument entity = super.get(id);
		if (entity != null) {
			getSession().delete(entity);
		}
		return entity;
	}
	
	@Override
	protected Class getEntityClass() {
		return ArticleDocument.class;
	}
	
	@Autowired
	public void setSuperSessionFactory(SessionFactory sessionFactory){
	    super.setSessionFactory(sessionFactory);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy