use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImpl method getByNo.
@Override
@Transactional(propagation = Propagation.REQUIRED)
public User getByNo(String no) {
Session session = sessionFactory.getCurrentSession();
List users = session.createQuery("from User where user_no='" + no + "'").list();
return (User) users.get(0);
}
use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImplTest method saveEntity.
@Test
public void saveEntity() throws Exception {
User user = getUser();
Integer id = userDao.saveEntity(user);
Assert.assertTrue(id > 8);
}
use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImplTest method getByName.
@Test
public void getByName() throws Exception {
User user = userDao.getByName("杜玉萍");
Assert.assertEquals("113", user.getUser_no());
}
use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImplTest method getUser.
private User getUser() throws ParseException {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
User user = new User();
user.setUser_name("李元芳");
user.setUser_no("114");
user.setPassword("efafa13");
user.setUser_sex("男");
Date bir = formatter.parse("1990-06-03 00:00:00");
user.setUser_birthday(bir);
user.setUser_class("95035");
Date cur = new Date();
user.setCreatetime(cur);
cur.setDate(-1);
user.setUpdatetime(cur);
return user;
}
use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImplTest method updateEntity.
@Test
public void updateEntity() throws Exception {
User user = getUser();
user.setId(10);
userDao.saveEntity(user);
}
Aggregations