Class DBControllerWidget

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

public class DBControllerWidget
extends DBController
The Class DBControllerWidget provide the statements for the data manipulation for the database tables SM_WIDGET and SM_PROFILE
Author:
Omar Duenas
  • Constructor Summary

    Constructors 
    Constructor Description
    DBControllerWidget()  
  • Method Summary

    Modifier and Type Method Description
    static void deleteProfile​(java.lang.String iD)
    Delete profile according to the user ID.
    static void insertProfile​(java.lang.String iD, java.lang.String widget)
    Insert profile in oder to recognize which widgets were assigned to which users.
    static java.util.ArrayList<java.lang.String> selectWidget​(java.lang.String iD)
    Select Widget Name which are assigned to certain users.
    static void setUniqueAttribute​(java.lang.String statement)
    Sets the attribute to unique.

    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

    • selectWidget

      public static java.util.ArrayList<java.lang.String> selectWidget​(java.lang.String iD)
      Select Widget Name which are assigned to certain users. The SQl statement stored in the constant SELECTALL will be executed in the H2 Database. As a result a List with the widgets name will be return.
      Parameters:
      iD - input parameter to select the desire user.
      Returns:
      the list with the widgets name for the corresponding user
    • insertProfile

      public static void insertProfile​(java.lang.String iD, java.lang.String widget)
      Insert profile in oder to recognize which widgets were assigned to which users. The constant INSERTPROFILE, contain the SQL statement to be execute in the H2 Database. Input parameters are the ID for the according user and the desire widget which should be assigned
      Parameters:
      iD - of the corresponding user
      widget - the name of the widget which will be assigned to the user
    • deleteProfile

      public static void deleteProfile​(java.lang.String iD)
      Delete profile according to the user ID. In the Profile tables are multiple entries for one user (1...n to one user could be more than one widget assigned)
      Parameters:
      iD - of the user to be deleted in the profile table.
    • setUniqueAttribute

      public static void setUniqueAttribute​(java.lang.String statement)
      Sets the attribute to unique. No duplicate entries should occur.
      Parameters:
      statement - prepare statement you want to execute