0
Personal have the record sequinte being returned by a query using SpringData
:
page = grupoService.findByNomeStartingWithOrderByNomeAsc(2, pageable);
If I run the following code:
System.out.println(page.getContent().get(0));
He prints:
Grupo{id=2, dtOperacao='2016-08-26'}
But when I convert to JSON
(to be sent to frontend
):
return new ResponseEntity<String>(new Gson().toJson(scSelect), headers, HttpStatus.OK);
The same converts the date to:
{"id": 1, "dtOperacao":{"year":2016,"month":8,"day":26}}
But he should return like this:
dtOperacao='2016-08-26'
Does anyone know how to solve this? Remembering that I need to keep using the Gson
.