如下:
public void deleteById(int id) {
User u = new User();
u.setId(id);
hibernateTemplate.delete(u);
}