DAOTrackImpl

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

## Class DAOTrackImpl

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

- All Implemented Interfaces:
    DAOTrack

      public class DAOTrackImpl
      extends AbstractDAO
      implements DAOTrack

  Implementations for DAOTrack.
  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
    `DAOTrackImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(int trackId)` Deletes a track from the database, if there are no images assigned to it.
    `java.util.ArrayList<Track>` | `findAll()` Returns all non-deleted tracks persisted in the database.
    `void` | `persist(Track track)` Persists a track to 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

    - #### DAOTrackImpl

          public DAOTrackImpl()

  - ### Method Detail

    - #### persist

          public void persist(Track track)
                       throws DAOTrackException

      Description copied from interface: `DAOTrack`
      Persists a track to the database.
      Specified by:
        `persist` in interface `DAOTrack`
      Parameters:
        `track` - Track object that has to be persisted.
      Throws:
        `DAOTrackException` - If persisting the track fails, specific feedback is given.

    - #### delete

          public void delete(int trackId)
                      throws DAOTrackException

      Description copied from interface: `DAOTrack`
      Deletes a track from the database, if there are no images assigned to it. If images are assigned to the track, the delete flag is set.
      Specified by:
        `delete` in interface `DAOTrack`
      Parameters:
        `trackId` - Id of track to be deleted.
      Throws:
        `DAOTrackException` - If deletion fails, specific feedback is given.

    - #### findAll

          public java.util.ArrayList<Track> findAll()
                                             throws DAOTrackException

      Description copied from interface: `DAOTrack`
      Returns all non-deleted tracks persisted in the database.
      Specified by:
        `findAll` in interface `DAOTrack`
      Returns:
        See description.
      Throws:
        `DAOTrackException` - If query fails, specific feedback is given.