Package srsim.persistence

Examples of srsim.persistence.DerbyEmbeddedDS.find()


    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());
  }

  @Test
  public void testRetrievingAllRecords() throws InstantiationException,
View Full Code Here


    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);
    Assert.assertTrue(storedRecords.isEmpty());
View Full Code Here

    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);
    Assert.assertTrue(storedRecords.isEmpty());
  }

}
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.