My DAOimpl
session.beginTransaction();
String password=login_name.getLogin_password();
String username=login_name.getLogin_name();
Query query=session.createQuery("select login_id,login_name,login_password from Login where login_name='"+username+"' and login_password='"+password+"'");
return query.list();
This is the code and I want to change these to CRITERIA. I want to verify the username and password for my login table using criteria is there any possibilities. Am using hibernate for mapping and am using Spring.
And also I want to convert the list into JSON format
I want to check username and password in my service and return that list into JSON format.I check number of examples but i did't have clear idea on that one.
Finally i use the Query to check my username and password and return that list and show it in my rest client.
But i want to show that in JSON how can do that one..?