com.oracle.email.dao

## Class UserDAO

- java.lang.Object
- - com.oracle.email.dao.BaseDAO
  - - com.oracle.email.dao.UserDAO

-     public class UserDAO
      extends BaseDAO

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserDAO()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UserTO` | `addUser(java.lang.String userJSON)` This method takes JSON string representing User table and writes it into the database
    `java.lang.String` | `addUser(UserTO userTO)`
    `void` | `createTable()` Each DAO class need to define how to create the table
    `UserTO` | `getUser(java.lang.String email, java.lang.String password)` This method returns the user account details if email and password are authenticated.
    `java.util.List<UserTO>` | `getUsers()` Display all the users ordered by email address using email secondary index.
    `static void` | `main(java.lang.String[] args)`

    - ### Methods inherited from class com.oracle.email.dao.BaseDAO

      `getHostPort, getKVStore, getStoreName, getTable, getTableAPI, getTableRows, setHostPort, setStoreName`

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

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

- - ### Constructor Detail

    - #### UserDAO

          public UserDAO()

  - ### Method Detail

    - #### createTable

          public void createTable()

      Description copied from class: `BaseDAO`
      Each DAO class need to define how to create the table
      Specified by:
        `createTable` in class `BaseDAO`

    - #### addUser

          public java.lang.String addUser(UserTO userTO)
                                   throws DAOException

      Throws:
        `DAOException`

    - #### getUser

          public UserTO getUser(java.lang.String email,
                                java.lang.String password)

      This method returns the user account details if email and password are authenticated.
      Parameters:
        `email` - - User's email used while creating the account
        `password` - - User's account password
      Returns:
        UserTO with all the details about the user

    - #### getUsers

          public java.util.List<UserTO> getUsers()

      Display all the users ordered by email address using email secondary index.
      Returns:
        List of user TOs ordered by email IDs

    - #### addUser

          public UserTO addUser(java.lang.String userJSON)
                         throws DAOException

      This method takes JSON string representing User table and writes it into the database
      Parameters:
        `userJSON` - - User can pass a JSON string representing User row. You can pass partial JSON string ie. not setting all the fields present in the user table.
      Returns:
        UserTO - Returns UsertTO with everything that was being passed plus system created values like userId, createdOn dates etc.
      Throws:
        `DAOException` - is thrown if user already exist with same userId

    - #### main

          public static void main(java.lang.String[] args)