I have table user(id,name,address) and User domain class.i want to get only the name of the user for the condition id=3.can i do with the findAll method.
I have table user(id,name,address) and User domain class.i want to get only the name
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, User.findAll…{…} would always return you fully loaded user objects. If you need only name of the user, you can write HQL for the same. For example :
User.executeQuery(“Select name from User where id=:id”, [id:3]”)