DAOImageImpl

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

## Class DAOImageImpl

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

- All Implemented Interfaces:
    DAOImage

      public class DAOImageImpl
      extends AbstractDAO
      implements DAOImage

  Implementations for DAOImage.
  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
    `DAOImageImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(int imageId)` Deletes an image from database if it's currently not in a track.
    `java.util.ArrayList<Image>` | `findAll()` Returns List of non-deleted images.
    `void` | `persist(java.lang.String titleEN, java.lang.String titleDE, java.lang.String originalContent, java.lang.String edgeContent)` Persists an image (original image + edge image) with translations 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

    - #### DAOImageImpl

          public DAOImageImpl()

  - ### Method Detail

    - #### persist

          public void persist(java.lang.String titleEN,
                              java.lang.String titleDE,
                              java.lang.String originalContent,
                              java.lang.String edgeContent)
                       throws DAOImageException

      Description copied from interface: `DAOImage`
      Persists an image (original image + edge image) with translations to the database.
      Specified by:
        `persist` in interface `DAOImage`
      Parameters:
        `titleEN` - English title of the image.
        `titleDE` - German title of the image.
        `originalContent` - Base64 encoded content of the original image.
        `edgeContent` - Base64 encoded content of the edge image.
      Throws:
        `DAOImageException`

    - #### delete

          public void delete(int imageId)

      Description copied from interface: `DAOImage`
      Deletes an image from database if it's currently not in a track. Sets deleted flag of image to true if image is currently in a track.
      Specified by:
        `delete` in interface `DAOImage`
      Parameters:
        `imageId` - ID of image to be deleted.

    - #### findAll

          public java.util.ArrayList<Image> findAll()

      Description copied from interface: `DAOImage`
      Returns List of non-deleted images.
      Specified by:
        `findAll` in interface `DAOImage`
      Returns:
        see description