Sun GlassFish Enterprise Server v2.1.1 Developer's Guide

Query Hints

Query hints are additional, implementation-specific configuration settings. You can use hints in your queries in the following format:

setHint("hint-name", hint-value)

For example:

Customer customer = (Customer)entityMgr.
     createNamedQuery("findCustomerBySSN").
     setParameter("SSN", "123-12-1234").
     setHint("toplink.refresh", true).
     getSingleResult();

For more information about the query hints available with the default provider, see Query Hints in TopLink JPA Extensions Reference.