You are selecting 3 things in you query:
select user1.userId, user1.userName, user1.password...
Thus your query will return a List<Object[]>
and not your UserPojo
Try something like this instead:
select user1 from UserPojo user1 where user1.userName=:userName and
user1.password=:password
EDIT:
So if you want your List<Object[]>
to become a List<UserPojo>
then you need to iterate through your List<Object[]>
and assign UserPojo's fields manually.
for(Object[] obj : list) {
UserPojo userPojo = ...
userPojo.setUserId(obj[0]);
...
}
Obs: I wouldn't use it like that, but that's up to you.