I am using the SQL objects API in the following lines of code in my data access object to get the name field from a row in an SQL table where the ID matches the one provided.
@SqlQuery("select name from users where id = :id")
String findNameById(@Bind("id") int id);
That works all well and good, but what on earth do I do if I want to return all of the fields for that row in the table, not just the name, but all colums for that record?
I did try using :
"select * from users where id = :id"
But that isn't right, it only seemed to return the id field (possibly as it is the first column in the table, and my method returns a string?)
Anyhow, I am all out of ideas on this and would appreciate all the help I can get.
Additional Info as I get requests for information :
This is the method signature of my method in the controller that calls my dao.
public String retrieveUserRecord(@PathParam("id") int id)
As you can see, it returns a string, as does the findNameByID method in the dao...
What I want to do, is pass the id using my method signature, and get back all of my columns as one nice JSON object if possible?