UserEvaluationDAO - ShutUpPaulo/TecProg_2016-01 GitHub Wiki

Class UserEvaluationDAO

Class Attributes

No attributes

Methods

UserEvaluationDAO

Return type: Constructor

Arguments: No arguments

Description: Constructor to instantiate a UserEvaluationDAO object

evaluateUser

Return type: void

Arguments: UserEvaluation evaluation - Evaluation given to the user (Must be >=0 and <=5)

Description: Method that saves or updates the user evaluation at database

evaluateUser attributes

Name Type Description Default Value
userEvaluationInDataBase JSONObject Stores the search result that contains the data of the user evaluation
query String Stores the query to update or save the user evaluation in database "INSERT INTO evaluate_user(grade, idUser, idUserEvaluated) VALUES (" + """ + evaluation.getUserRating() + ""," + """ + evaluation.getIdUserLoggedIn() + ""," + """ + evaluation.getIdUserEvaluated() + "")"

searchUserEvaluation

Return type: JSONObject - Data of the user evaluation given by the evaluator user

Arguments:

int userEvaluatedtId - Identifier of the user to be evaluated

int userId - Identifier of the evaluator user

Description: Method that search the evaluation of an user, given by another user

searchUserEvaluation attributes

Name Type Description Default Value
QUERY String Stores the query to search an user evaluation in database "SELECT * FROM evaluate_user WHERE idUser = "" + userId + "" AND idUserEvaluated = " + userEvaluatedtId
userEvaluation JSONObject Stores the search result that contains the data of the user evaluation