private void loadCombobox() {
    List<InepEvent> events = getSession().getEvents(getPrincipal());

    if (SysUtils.isEmpty(getComboEvent().getItems()) == false) {
      getComboEvent().getItems().clear();
    }
    for (InepEvent e : events) {
      Comboitem item = getComboEvent().appendItem(e.getDescription());
      item.setValue(e);
    }
    if (getComboEvent().getItemCount() > 0) {
      getComboEvent().setSelectedIndex(0);
      onSelectPackage();
    }
  }
  /**
   * <penPageSequence>select o from UserDocument o where o.penPageSequence = :document and
   * o.documentType.formId = :docType</penPageSequence>
   *
   * <p>Este é a função privada que realiza a busca por um documento de usuario no banco de dados.
   *
   * @param document Código (Número, ID) do documento
   * @param docTypeId Código sequencial inteiro do tipo do documento
   * @return UserDocument Entity Bean
   * @exception InvalidParameterException
   */
  protected UserDocument find(String document, Integer docTypeId) {
    UserDocument doc = null;

    if (SysUtils.isEmpty(document) || docTypeId == null) {
      throw new InvalidParameterException("O parametro nao pode ser nulo ou vazio ");
    }

    try {
      Query query = getEntityManager().createNamedQuery(UserDocument.getByDocument);
      query.setParameter("document", document);
      query.setParameter("docType", docTypeId);
      doc = (UserDocument) query.getSingleResult();
    } catch (Exception e) {
      e.printStackTrace();
      e = null;
    }
    return doc;
  }
Пример #3
0
 public FormDTO setApplication(String ip) {
   if (SysUtils.isEmpty(ip))
     throw new InvalidParameterException("O ip do formulário não pode ser nulo ou vazio");
   this.application = ip;
   return this;
 }
Пример #4
0
 @Override
 public Media findByName(String name) {
   List<Media> medias = this.findByNamedQuery(Media.getByName, name);
   return SysUtils.isEmpty(medias) ? null : medias.get(0);
 }
 public SystemUserPropertyDTO get(Integer id) throws ApplicationException {
   if (SysUtils.isZero(id)) throwException(4);
   return SystemUserPropertyUtil.copy(session.get(id));
 }
 public void delete(AuthenticationDTO auth, Integer id) throws ApplicationException {
   if (SysUtils.isZero(id)) throwException(4);
   authenticate(auth);
   session.delete(id);
 }