List of usage examples for javax.persistence NonUniqueResultException printStackTrace
public void printStackTrace()
From source file:net.o3s.beans.registering.RegisteringBean.java
/** * Get registered from label/*from ww w. j av a 2s . c o m*/ */ public IEntityRegistered findRegisteredFromLabel(final String labelValue) throws InvalidException { Query query = this.entityManager.createNamedQuery("REGISTERED_FROM_LABEL"); IEntityEvent event = admin.findDefaultEvent(); query.setParameter("EVENTID", event.getId()); query.setParameter("VALUE", labelValue); IEntityRegistered registered = null; try { registered = (IEntityRegistered) query.getSingleResult(); } catch (javax.persistence.NoResultException nre) { } catch (NonUniqueResultException nure) { nure.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard [" + labelValue + "]", nure); } catch (Exception e) { e.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard [" + labelValue + "]", e); } return registered; }
From source file:net.o3s.beans.registering.RegisteringBean.java
/** * Get registered from rfid tag//from ww w.j a v a2 s. c o m */ public IEntityRegistered findRegisteredFromRfid(final String rfid) throws InvalidException { Query query = this.entityManager.createNamedQuery("REGISTERED_FROM_RFID"); query.setParameter("RFID", rfid); IEntityEvent event = admin.findDefaultEvent(); query.setParameter("EVENTID", event.getId()); IEntityRegistered registered = null; try { registered = (IEntityRegistered) query.getSingleResult(); } catch (javax.persistence.NoResultException nre) { } catch (NonUniqueResultException nure) { nure.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard avec pour tag rfid [" + rfid + "]", nure); } catch (Exception e) { e.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard avec pour tag rfid [" + rfid + "]", e); } return registered; }
From source file:net.o3s.beans.registering.RegisteringBean.java
/** * Get registered from labelNumber/*from w ww. j a v a 2 s . com*/ */ public IEntityRegistered findRegisteredFromLabelNumber(final int labelNumber) throws InvalidException { Query query = this.entityManager.createNamedQuery("REGISTERED_FROM_LABELNUMBER"); IEntityEvent event = admin.findDefaultEvent(); query.setParameter("EVENTID", event.getId()); query.setParameter("VALUE", labelNumber); IEntityRegistered registered = null; try { registered = (IEntityRegistered) query.getSingleResult(); } catch (javax.persistence.NoResultException nre) { } catch (NonUniqueResultException nure) { nure.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard [" + labelNumber + "]", nure); } catch (Exception e) { e.printStackTrace(); throw new InvalidException("Impossible de trouver ce dossard [" + labelNumber + "]", e); } return registered; }