Map Query Result Java. As we want to map our query results to a value object we need an additional class called BookValue with an id a version a title and the name of the author. Since we have a projection of two columns where the first one is unique we are better off returning a Map instead.
There are 2 options to define the mapping. But thats actually not right for this example anyway. You can use the JPQL constructor expression or fetch the results as a Tuple.
Since we have a projection of two columns where the first one is unique we are better off returning a Map instead.
Return instead a plain old javautilMap. Sql Resultset Mapping With Alias. Query an mSQL database using. In many JDBC applications youll probably want to do something else with the results such as displaying them in a table or grid in a GUI applet or application.