I am using JPA and and Jackson is used for generating JSON
Emp.java
@Entity
@NamedQuery(name = \"Emp.findAll\",
query = \"select o.empNo, o.
In the first case, your JPQL returns a List
; each item in the list is an array containing the values of o.empNo
and o.empName
. Of course, when JSON is produced, it is produced as an array/list of items.
In the second case, you get a List
, which each item being an Employee
instance, so it is serialized like an object would be (list of attribute-values).