SuperDAO.java
package com.bebig.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class SuperDAO extends HibernateDaoSupport {

    @Resource(name 
= "sessionFactory")//注入sessionFactory
    public void setSuperSessionFactory(SessionFactory sessionFactory) {
        
super.setSessionFactory(sessionFactory);
    }


}

LogDAOImpl.java
package com.bebig.dao.impl;

import org.springframework.stereotype.Repository;

import com.bebig.dao.LogDAO;
import com.bebig.model.Log;

@Repository
public class LogDAOImpl extends SuperDAO implements LogDAO {

    @Override
    
public void save(Log log) {
        
this.getHibernateTemplate().save(log);
    }


}

UserDAOImpl.java
package com.bebig.dao.impl;

import org.springframework.stereotype.Repository;
import com.bebig.dao.UserDAO;
import com.bebig.model.User;

@Repository
public class UserDAOImpl extends SuperDAO implements UserDAO {

    @Override
    
public void save(User u) {
        
this.getHibernateTemplate().save(u);
    }


}