To facilitate reuse of queries users can assign symbolic names to them and store such named queries in a DataMap. Normally this is done by creating a query in CayenneModeler. Storing queries in a DataMap reduces the amount of code and speeds up query creation process.
This example shows how to get a shared instance of a stored query, and use it as a template for customized query.
DataContext supports running a named query with preset parameters directly: