SQL Query using Hibernate to map the data from MySQL
===

I am implementing a Restful Web Service in java (JAX-RS) using Jesey. I run it on Tomcat v7.0 I use Hibernate to map the data to the database (MySQL). I have a query to fetch the list of deliverable:

   

    deliverables = (List<Deliverable>) session.createQuery("Select deliverable from
                    Task as t where t.project.id= :id And t.user.username = :name")
        .setLong("id", projectId).setString("name", username).list();

It is giving me a hundred of deliverables, but I want to have three of them where id is MAX in Task table. I appreciate for any help. How can I modify the query?