use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImplTest method deleteUserByEntity.
@Test
public void deleteUserByEntity() throws Exception {
User user = getUser();
user.setId(10);
userDao.deleteUserByEntity(user);
}
use of com.zsm.ssh.model.User in project Resource by lovelifeming.
the class UserDaoImpl method deleteUserByEntity.
@Override
@Transactional(propagation = Propagation.REQUIRED)
public void deleteUserByEntity(User user) {
Session session = sessionFactory.getCurrentSession();
// 传入实例对象,比较id删除对应行,,没有id匹配就不删除
session.delete(User.class.getName(), user);
}
Aggregations