login(username, password, loginOption, doneCallback, failCallback) {
    if (loginOption instanceof Function) {
      failCallback = doneCallback;
      doneCallback = loginOption;
      loginOption = true;
    }

    return this._db.login(username, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
  }
/**
   * Log in the user with the given username and password and starts a user session
   * @param {string} username The username of the user
   * @param {string} password The password of the user
   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
   * @return {Promise<model.User>}
   */
Log in the user with the given username and password and starts a user session
@param {string} username The username of the user
@param {string} password The password of the user
@param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
@param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
@param {binding.Entity~failCallback=} failCallback Called when the operation failed.
@return {Promise}
Log in the user with the given username and password and starts a user session @param { string } username The username of the user @param { string } password The password of the user @param { boolean|binding . UserFactory . LoginOption } [ loginOption = true ] The default keeps the user logged in over multiple sessions @param { binding . Entity~doneCallback = } doneCallback Called when the operation succeed . @param { binding . Entity~failCallback = } failCallback Called when the operation failed . @return { Promise }
login(username, password, loginOption, doneCallback, failCallback) {
    if (loginOption instanceof Function) {
      failCallback = doneCallback;
      doneCallback = loginOption;
      loginOption = true;
    }
    return this._db.login(username, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
  }
login ( username , password , loginOption , doneCallback , failCallback ) { if ( loginOption instanceof Function ) { failCallback = doneCallback ; doneCallback = loginOption ; loginOption = true ; } return this . _db . login ( username , password , loginOption === undefined ? true : loginOption ) . then ( doneCallback , failCallback ) ; }
Log in the user with the given username and password and starts a user session
 @param {string} username The username of the user
 @param {string} password The password of the user
 @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
 @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
Log in the user with the given username and password and starts a user session @param { string } username The username of the user @param { string } password The password of the user @param { boolean|binding . UserFactory . LoginOption } [ loginOption = true ] The default keeps the user logged in over multiple sessions @param { binding . Entity~doneCallback = } doneCallback Called when the operation succeed .