You can use four different approaches in defining named queries:
RQL Named Queries
SQL Named Queries
Stored Procedures
Defining and Accessing Named Queries in Java Code