DAOSessionImpl

com.j0h1.contour.admin.server.dao.impl

## Class DAOSessionImpl

- java.lang.Object
- - com.j0h1.contour.admin.server.dao.AbstractDAO
  - - com.j0h1.contour.admin.server.dao.impl.DAOSessionImpl

- All Implemented Interfaces:
    DAOSession

      public class DAOSessionImpl
      extends AbstractDAO
      implements DAOSession

  Implementations for DAOSession.
  Author:
    Johannes Riedmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.sql.Connection` | `connection`
    `private DatabaseManager` | `dbm`
    `private java.sql.PreparedStatement` | `prep`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DAOSessionImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(int sessionId)` Deletes a session with specified sessionId from the database.
    `java.util.ArrayList<Session>` | `findAll()` Retrieves a list of all sessions (custom and track sessions) persisted in the database.

    - ### Methods inherited from class com.j0h1.contour.admin.server.dao.AbstractDAO

      `closeConnection, openConnection, setAutoCommit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### connection

          private java.sql.Connection connection

    - #### prep

          private java.sql.PreparedStatement prep

    - #### dbm

          private DatabaseManager dbm

  - ### Constructor Detail

    - #### DAOSessionImpl

          public DAOSessionImpl()

  - ### Method Detail

    - #### findAll

          public java.util.ArrayList<Session> findAll()
                                               throws DAOSessionException

      Description copied from interface: `DAOSession`
      Retrieves a list of all sessions (custom and track sessions) persisted in the database.
      Specified by:
        `findAll` in interface `DAOSession`
      Returns:
        List of all sessions in the database.
      Throws:
        `DAOSessionException` - If the query fails, specific feedback is returned

    - #### delete

          public void delete(int sessionId)
                      throws DAOSessionException

      Description copied from interface: `DAOSession`
      Deletes a session with specified sessionId from the database. Along with the session, the drawings and score images are deleted. If the session is a custom session, the original data, as well as the edge data is deleted too.
      Specified by:
        `delete` in interface `DAOSession`
      Parameters:
        `sessionId` - ID of the session to be deleted.
      Throws:
        `DAOSessionException` - If deletion fails, specific feedback is returned.