Class DerbyMeter

java.lang.Object
be.gaudry.dao.brolmeter.derby.DerbyMeter
All Implemented Interfaces:
IMeter

public class DerbyMeter extends Object implements IMeter
Since:
1.0 Sep 29, 2009
Author:
Steph GAUDRY
  • Constructor Details

    • DerbyMeter

      public DerbyMeter()
  • Method Details

    • getHouse

      public House getHouse(int id)
      Specified by:
      getHouse in interface IMeter
    • getDefaultHouse

      public House getDefaultHouse()
      Specified by:
      getDefaultHouse in interface IMeter
    • getLazyHouse

      public House getLazyHouse(int id)
    • saveHouse

      public int saveHouse(House house)
      Saves house informations and insert all the meters
      Parameters:
      house -
    • saveLazyHouse

      public int saveLazyHouse(House house)
      Saves only house informations (not the meters)
      Parameters:
      house -
    • loadMeter

      public Meter loadMeter(int meterId)
      Description copied from interface: IMeter
      Loads measures for a given meter identifier and a given year.
      Specified by:
      loadMeter in interface IMeter
      Returns:
    • loadMeter

      public Meter loadMeter(int meterId, int year)
      Description copied from interface: IMeter
      Loads measures for a given meter identifier and a given year.
      Only measures matching the given year are loaded, and the first measure of the following month. The first measure of the following month is needed to compute consumption of the last month of the given year.
      Specified by:
      loadMeter in interface IMeter
      year - the requested year, or -1 to return all measures.
      Returns:
    • saveMeter

      public int saveMeter(Meter meter)
      Specified by:
      saveMeter in interface IMeter
      Parameters:
      meter - Meter to save
      Returns:
      meter id
    • updateLazyMeter

      public void updateLazyMeter(Meter meter)
      Updates the meter informations, but not saves the measures
      Parameters:
      meter -
    • saveLazyMeter

      public int saveLazyMeter(Meter meter)
    • saveMeasure

      public int saveMeasure(Measure measure)
      Specified by:
      saveMeasure in interface IMeter
      Parameters:
      measure - to save
      Returns:
      measure id