I'm learning Java and database handling, and I'm having problems working with named querys.
@NamedQuery(name = "AuthTable.getUserNames", query = "SELECT a.firstName, a.birthName, a.lastName FROM AuthTable a WHERE a.name = :name")})
I retrieve the information with:When I use the first NamedQuery I can cast "Object result" to "String" and everything goes well.
With the second query JAVA won't let me cast "Object result" to anything. Not to "Array", not to "List", not to anything. "Object result" is useless for me!
When I use "q.getResultList()" I get a list with one element, which equals to "Object result", that is useless for me here too.