Package srsim.persistence

Examples of srsim.persistence.DerbyEmbeddedDS.persist()


    SimulationRecord record = new SimulationRecord();
    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.setBrightness(42.0D);
    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);
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.