Class RunDAO

java.lang.Object
com.assemblyrobot.shared.db.dao.RunDAO
All Implemented Interfaces:
DAO

public class RunDAO
extends java.lang.Object
implements DAO
DAO for accessing the simulator run history database.
  • Method Summary

    Modifier and Type Method Description
    boolean deleteRun​(long id)
    Deletes a run from the database based on its ID.
    void finalize()  
    RunDTO[] getAllRuns()
    Returns an array of all runs in the database.
    RunDTO getRun​(long id)
    Gets a simulator run by ID.
    boolean logRun​(RunDTO run, EngineDTO engine, StageControllerDTO stageController, StationDTO[] stations, MaterialDTO[] materials)
    Logs a simulator run.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getRun

      public RunDTO getRun​(long id)
      Gets a simulator run by ID.
      Specified by:
      getRun in interface DAO
      Parameters:
      id - RunDTO ID
      Returns:
      RunDTO
    • getAllRuns

      public RunDTO[] getAllRuns()
      Returns an array of all runs in the database.
      Specified by:
      getAllRuns in interface DAO
      Returns:
      RunDTO[]
    • logRun

      public boolean logRun​(RunDTO run, EngineDTO engine, StageControllerDTO stageController, StationDTO[] stations, MaterialDTO[] materials)
      Logs a simulator run.
      Specified by:
      logRun in interface DAO
      Parameters:
      run - RunDTO
      engine - EngineDTO
      stageController - StageControllerDTO
      stations - StationDTO[]
      materials - MaterialDTO[]
      Returns:
      Boolean indicating whether the logging of the run was successful.
    • deleteRun

      public boolean deleteRun​(long id)
      Deletes a run from the database based on its ID.
      Specified by:
      deleteRun in interface DAO
      Parameters:
      id - RunDTO ID
      Returns:
      Boolean indicating whether deletion was successful.
    • finalize

      public void finalize()
      Overrides:
      finalize in class java.lang.Object