Class DBControllerPerson

java.lang.Object
lukas.wais.smart.mirror.controller.DBController
lukas.wais.smart.mirror.controller.DBControllerPerson

public class DBControllerPerson
extends DBController
The Class DBControllerPerson provide the statements for the data manipulation for the database table SM_USERS
Author:
Omar Duenas
  • Constructor Summary

    Constructors 
    Constructor Description
    DBControllerPerson()  
  • Method Summary

    Modifier and Type Method Description
    void deletePerson​(java.lang.String iD)
    Delete the desire person by ID
    void insertPerson​(Person person)
    Insert a new person to the table SM_USERS.
    static java.util.List<Person> selectAllPersons()
    Select all the information of the persons in the table SM_USERS.
    static Person selectPerson​(java.lang.String iD)
    Select all the information of a person for the corresponding ID.
    void updateEM​(java.lang.String email, java.lang.String iD)
    Update the person email for the given ID
    void updateFN​(java.lang.String firstName, java.lang.String iD)
    Update the person firstname for the given ID
    void updateLN​(java.lang.String lastName, java.lang.String iD)
    Update the person lastname for the given ID
    void updateNK​(java.lang.String nikeName, java.lang.String iD)
    Update the person nickname for the given ID

    Methods inherited from class lukas.wais.smart.mirror.controller.DBController

    getConnection

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • selectPerson

      public static Person selectPerson​(java.lang.String iD)
      Select all the information of a person for the corresponding ID.
      Parameters:
      iD - of the desire user as an input parameter
      Returns:
      the person data found in the database
    • selectAllPersons

      public static java.util.List<Person> selectAllPersons()
      Select all the information of the persons in the table SM_USERS.
      Returns:
      the list of found persons
    • insertPerson

      public void insertPerson​(Person person)
      Insert a new person to the table SM_USERS.
      Parameters:
      person - the person
    • updateFN

      public void updateFN​(java.lang.String firstName, java.lang.String iD)
      Update the person firstname for the given ID
      Parameters:
      firstName - the new first name to be updated
      iD - the ID of the person to be updated
    • updateLN

      public void updateLN​(java.lang.String lastName, java.lang.String iD)
      Update the person lastname for the given ID
      Parameters:
      lastName - the new last name to be updated
      iD - the ID of the person to be updated
    • updateNK

      public void updateNK​(java.lang.String nikeName, java.lang.String iD)
      Update the person nickname for the given ID
      Parameters:
      nikeName - the new nickname to be updated
      iD - the ID of the person to be updated
    • updateEM

      public void updateEM​(java.lang.String email, java.lang.String iD)
      Update the person email for the given ID
      Parameters:
      email - the new email to be updated
      iD - the ID of the person to be updated
    • deletePerson

      public void deletePerson​(java.lang.String iD)
      Delete the desire person by ID
      Parameters:
      iD - the iD of the person to be deleted