String queryName = useNamedRegion ? "musician.byinstrument.namedregion"
: "musician.byinstrument.default";
Query query = manager.createNamedQuery(queryName);
query.setParameter(1, instrument);
List<MusicianPK> result = new ArrayList<MusicianPK>();
List users = query.getResultList();
if (users != null)
{
for (Iterator it = users.iterator(); it.hasNext();)
{
result.add(((Musician) it.next()).getId());
}
}
return result;