I have a table Bookorder with an Identity column
Id
.I can execute the following:
Query query1 = em.createQuery("SELECT MAX(b.id) FROM Bookorder b");
int bo_max=(Integer)query1.getSingleResult();
Please notice that it's Integer and not int when casting the result of query.
No comments:
Post a Comment