Package srsim.persistence

Examples of srsim.persistence.Criterion


    record.setBrightness(100.0D);
    record.setTemperature(15.0D);
    record.setEnergyConsumption(1400.0D);
    record.setTimeStamp(System.currentTimeMillis());
    ds.persist(record);
    Criterion criterion = new Criterion("temperature").lessEqual("20").and(
        new Criterion("brightness").lessThan("10000"));
    List<SimulationRecord> storedRecords = ds.find(criterion);
    Assert.assertFalse(storedRecords.isEmpty());
  }
View Full Code Here


    record.setTemperature(42.0D);
    record.setEnergyConsumption(42.0D);
    long timeStamp = System.currentTimeMillis();
    record.setTimeStamp(timeStamp);
    ds.persist(record);
    Criterion criterion = new Criterion("timestamp").equal(String.valueOf(timeStamp));
    List<SimulationRecord> storedRecords = ds.find(criterion);
    Assert.assertFalse(storedRecords.isEmpty());
    record = storedRecords.get(0);
    ds.delete(record);
    storedRecords = ds.find(criterion);
View Full Code Here

    contentPane.add(sp);

    btnSearch.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent arg0) {
        List<SimulationRecord> result = dataStore.find(new Criterion(
            textField.getText()));
        for (SimulationRecord record : result) {
          textArea.append(String.format("%tT ", record.getTimeStamp()));
          textArea.append(record.getRoomId());
          textArea.append(String.format(" %.2fW",
View Full Code Here

TOP

Related Classes of srsim.persistence.Criterion

Copyright © 2018 www.massapicom. 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.