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 SummaryConstructors Constructor Description DBControllerWidget()
- 
Method SummaryModifier and Type Method Description static voiddeleteProfile(java.lang.String iD)Delete profile according to the user ID.static voidinsertProfile(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 voidsetUniqueAttribute(java.lang.String statement)Sets the attribute to unique.
- 
Constructor Details- 
DBControllerWidgetpublic DBControllerWidget()
 
- 
- 
Method Details- 
selectWidgetpublic 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
 
- 
insertProfilepublic 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
 
- 
deleteProfilepublic 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.
 
- 
setUniqueAttributepublic 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
 
 
-