Examples of Patrulla


Examples of es.emergya.bbdd.bean.Patrulla

  @Transactional
  public void testAll() throws Exception {
    List<Patrulla> all = patrullaHome.getAll();
    assertNotNull(all);
    assertTrue(all.size() > 0);
    Patrulla p = all.get(0);
    assertNotNull(patrullaHome.getByFilter(p));
    assertTrue(patrullaHome.getByFilter(p).size() > 0);
    assertEquals(p, patrullaHome.getByFilter(p).get(0));
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

  }

  @Test
  @Transactional
  public void testAsigneds() throws Exception {
    Patrulla p = null;
    for (Patrulla p2 : PatrullaConsultas.getAllTests())
      if (p2.getRecursos().size() > 0)
        p = p2;
    assertNotNull(p);
    assertNotNull(recursoHome.getAsigned(p));
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

            i18n.getString("admin.patrullas.tabla.titulo.nombre"),
            i18n.getString("admin.patrullas.tabla.titulo.ficha"),
            i18n.getString("admin.patrullas.tabla.titulo.eliminar") },
        new String[][] { {} }, getNoFiltrarAction(), getFiltrarAction());

    squads.setTableData(getAll(new Patrulla()));
    squads.setErrorCause(i18n.getString("Squads.errorCause"));
    this.add(squads);
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

      private static final long serialVersionUID = -1096192874098385825L;

      @Override
      protected void applyFilter(JTable filters) {
        final Patrulla example = new Patrulla();
        final Object valueAt = filters.getValueAt(0, 1);
        if (valueAt != null && valueAt.toString().length() > 0) {
          example.setNombre(valueAt.toString());
        }
        squads.setTableData(getAll(example));
      }
    };
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

      private static final long serialVersionUID = -6566681011645411911L;

      @Override
      protected void applyFilter() {
        squads.setTableData(getAll(new Patrulla()));
      }
    };
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

                  JOptionPane.YES_NO_CANCEL_OPTION);

              if (i == JOptionPane.YES_OPTION) {

                if (original == null) {
                  original = new Patrulla();
                }

                original.setInfoAdicional(textfieldPie
                    .getText());
                original.setNombre(textfieldCabecera.getText());

                HashSet<Recurso> recursos = new HashSet<Recurso>();
                for (Object r : ((DefaultListModel) right
                    .getModel()).toArray()) {
                  if (r instanceof Recurso) {
                    recursos.add((Recurso) r);
                    ((Recurso) r).setPatrullas(original);
                  } else {
                    log.error("El objeto no era un recurso");
                  }
                }
                original.setRecursos(recursos);

                PatrullaAdmin.saveOrUpdate(original);
                PluginEventHandler.fireChange(AdminSquads.this);

                cambios = false;
                original = null;

                squads.setTableData(getAll(new Patrulla()));

                closeFrame();
              } else if (i == JOptionPane.NO_OPTION) {
                closeFrame();
              }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

                        "El recurso está deshabilitado ('"
                        + recurso.getDispositivo() + "')");
            }
            recurso.setMalAsignado(true);

            Patrulla p = PatrullaConsultas.find(campos[2]);
            if (p == null) {
                throw new MessageProcessingException(
                        "No encuentro la patrulla " + campos[2]);
            }
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

    return res;
  }

  @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true, rollbackFor = Throwable.class)
  public Patrulla find(String p) {
    Patrulla res = null;

    try {
      Session currentSession = getSession();
      currentSession.clear();
      res = (Patrulla) currentSession.createCriteria(Patrulla.class)
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

    log.debug("Saving " + p);
    try {
      Session currentSession = getSession();
      currentSession.clear();

      Patrulla entity = null;

      if (p.getId() != null && this.get(p.getId()) != null)
        entity = (Patrulla) currentSession.merge(p);
      else
        entity = p;
View Full Code Here

Examples of es.emergya.bbdd.bean.Patrulla

   *            Nombre de la patrulla a buscar
   * @return La patrulla correspondiente, o null en caso de no existir
   */
  @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true, rollbackFor = Throwable.class)
  public Patrulla findPatrullaByNombre(String nombre) {
    Patrulla resultado;
    if (nombre != null && !nombre.equals("")) {
      Criteria crit = getSession().createCriteria(Patrulla.class).add(
          Restrictions.like("nombre", nombre));
      resultado = (Patrulla) crit.uniqueResult();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.