Skip to content
Advertisement

How can I show Multiple Rows in JSON

I need to show sql result

in a JSON like this

JavaScript

in a spring boot app.

Class

JavaScript

Repo

JavaScript

Service

JavaScript

Controller

JavaScript

I’m getting this message on log:

query did not return a unique result: 94; nested exception is >javax.persistence.NonUniqueResultException: query did not return a unique result: 94

After that, I wanna delete/update all of salesperson associated id’s (transfer clients (id’s) from one to another .

Advertisement

Answer

The javax.persistence.NonUniqueResultException indicates that there is more than one result from the query. Looking at your data, indeed, you have more than one row where the slpCode is 700.

You have to change the return type to List of Vendedor:

JavaScript

If no vendors are found an empty list will be returned.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement