Doubt when generating procedure return REST in jersey

0

I have a method where the return of it is a list, based on an execution of a procedure in the bank

 StoredProcedureQuery spq
                = em.createStoredProcedureQuery("PROCEDURE");
 ....

The return of this query are some fields in a table, and others are calculated fields.  And this feedback I make available in json

@GET
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
....

Well, I have a small problem, the json generated from this procedure is invalid, the jersey puts keys in front and at the end, and does not name fields, just values, return example:

   ["300", "ABCD", "Teste"]

In other calls I convert the procedure return into object

StoredProcedureQuery spq
                = em.createStoredProcedureQuery("PROCEDURE", MinhaClasse.class);

and it works, but this time, the returns are not from fields in the database, but some calculated fields, so I can not do that.

Does anyone know what can be done in my case?

Example Return Procedure:

-Name and Product Code-OK, I have in the entity -Value Total of the items in stock, This field is calculated in the procedure, I can not add in the Entity. Among other calculated fields it returns.

    
asked by anonymous 19.02.2016 / 12:57

0 answers