I need to bring from DB only one single result. How can I do that with JPA?
Select top 1 * from table
I tried
"select t from table t"
query.setMaxResults(1);
query.getSingleResult();
but didn't work. Any other ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…