Skip to content

Instantly share code, notes, and snippets.

@jeetprksh
Last active August 14, 2018 07:25
Show Gist options
  • Save jeetprksh/05f1e72c96b9fcd521cc4b32b1a00973 to your computer and use it in GitHub Desktop.
Save jeetprksh/05f1e72c96b9fcd521cc4b32b1a00973 to your computer and use it in GitHub Desktop.
@Repository
public class UserDaoImpl implements UserDao {
@Autowired
private SessionFactory sessionFactory;
@Override
public UserDTO getUser(Long userId) {
TypedQuery<UserDTO> typedQuery = sessionFactory.getCurrentSession().createQuery("from UserDTO where id=" + userId.toString());
return typedQuery.getSingleResult();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment