this.telephone = telephone;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "register_time", length = 19)
public Date getRegisterTime() {
return this.registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
}
接口自己处理
package com.dao.impl;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.dao.UserDao;
import com.entity.AcctUser;
@Repository("userDao")
public class UserDaoImpl implements UserDao {
@Autowired
private SessionFactory sessionFactory;
private Session getCurrentSession() {
return this.sessionFactory.getCurrentSession();
}
public AcctUser load(String id) {
return (AcctUser) this.getCurrentSession().load(AcctUser.class, id);
}
public AcctUser get(String id) {

return (AcctUser) this.getCurrentSession().get(AcctUser.class, id);
}
@SuppressWarnings("unchecked")
public List<AcctUser> findAll() {
List<AcctUser> acctUsers = this.getCurrentSession().createQuery("from AcctUser").setCacheable(true).list();
return acctUsers;
}
public void delete(String id) {
AcctUser entity = this.load(id);
this.getCurrentSession().delete(entity);
}
public void flush() {
this.getCurrentSession().flush();
}
public String save(AcctUser entity) {
return (String) this.getCurrentSession().save(entity);
}
}
package com.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-65857-11.html
#吴亦凡#
理智理智