return (ChoiceSet) (session.load(ChoiceSetImpl.class, id)); } catch (net.sf.hibernate.ObjectNotFoundException onfe) { throw new edu.internet2.middleware.signet.ObjectNotFoundException(onfe); } catch (HibernateException e) { throw new SignetRuntimeException(e); }
query = session .createQuery ("from edu.internet2.middleware.signet.ChoiceSetImpl" + " as choiceSet" + " where choiceSetID = :id");  query.setString("id", choiceSetId);  resultList = query.list(); } catch (HibernateException e) { throw new SignetRuntimeException(e); }  if (resultList.size() > 1) { throw new SignetRuntimeException ("Found " + resultList.size() + " ChoiceSet instances in the database matching choiceSetId '" + choiceSetId + "'. This value should be unique."); }  if (resultList.size() == 0) { throw new ObjectNotFoundException ("Unable to fetch ChoiceSet with choiceSetId '" + choiceSetId + "'."); }    Set resultSet = new HashSet(resultList); Iterator resultSetIterator = resultSet.iterator(); choiceSet= (ChoiceSetImpl)(resultSetIterator.next()); choiceSet.setSignet(this);  return choiceSet;
 public final ChoiceSet getChoiceSet(String id) throws ObjectNotFoundException {   try   {     return (ChoiceSet) (session.load(ChoiceSetImpl.class, id));   }   catch (net.sf.hibernate.ObjectNotFoundException onfe)   {     throw new      edu.internet2.middleware.signet.ObjectNotFoundException(onfe);   }   catch (HibernateException e)   {     throw new SignetRuntimeException(e);   } }