Use criteria queries.