Skip to content
Advertisement

Select top 1 result using JPA

I need to bring from DB only one single result. How can I do that with JPA?

JavaScript

I tried

“select t from table t”

JavaScript

but didn’t work. Any other ideas?

Advertisement

Answer

Try like this

JavaScript

It should work

UPDATE*

You can also try like this

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