private void extractAndAddNamedQueries(final ClassDescriptorJDONature jdoNature,
final ClassMapping clsMap)
throws MappingException {
Enumeration namedQueriesEnum = clsMap.enumerateNamedQuery();
while (namedQueriesEnum.hasMoreElements()) {
NamedQuery query = (NamedQuery) namedQueriesEnum.nextElement();
String queryName = query.getName();
if (_queryNames.contains(queryName)) {
throw new MappingException(
"Duplicate entry for named query with name " + queryName);
}
_queryNames.add(queryName);
jdoNature.addNamedQuery(queryName, query.getQuery());
}
}