DAOPlayerImpl

com.j0h1.contour.server.dao.impl

## Class DAOPlayerImpl

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

- All Implemented Interfaces:
    DAOPlayer

      public class DAOPlayerImpl
      extends AbstractDAO
      implements DAOPlayer

  Implementations for DAOPlayer.
  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
    `DAOPlayerImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Player` | `findPlayerByPhoneId(java.lang.String phoneId)` Queries the database for a player with a specific phoneId.
    `Player` | `persist(Player player)` Persists a new Player to the database.

    - ### Methods inherited from class com.j0h1.contour.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

    - #### DAOPlayerImpl

          public DAOPlayerImpl()

  - ### Method Detail

    - #### findPlayerByPhoneId

          public Player findPlayerByPhoneId(java.lang.String phoneId)
                                     throws DAOPlayerException

      Description copied from interface: `DAOPlayer`
      Queries the database for a player with a specific phoneId.
      Specified by:
        `findPlayerByPhoneId` in interface `DAOPlayer`
      Parameters:
        `phoneId` - Unique Android device identifier for the player's phone.
      Returns:
        Fully specified Player object. Empty Player object is player was not found.
      Throws:
        `DAOPlayerException` - When the query fails, a DAOPlayerException is thrown.

    - #### persist

          public Player persist(Player player)
                         throws DAOPlayerException

      Description copied from interface: `DAOPlayer`
      Persists a new Player to the database.
      Specified by:
        `persist` in interface `DAOPlayer`
      Parameters:
        `player` - Player object to be persisted.
      Returns:
        Fully specified Player object. Empty Player object is player was not persisted successfully.
      Throws:
        `DAOPlayerException` - When persistence fails, a DAOPlayerException is thrown.