Esempio n. 1
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, TokensBD entity) {
    stmt.clearBindings();

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }

    Long expiresIn = entity.getExpiresIn();
    if (expiresIn != null) {
      stmt.bindLong(2, expiresIn);
    }

    Long expiresAt = entity.getExpiresAt();
    if (expiresAt != null) {
      stmt.bindLong(3, expiresAt);
    }

    String tokenType = entity.getTokenType();
    if (tokenType != null) {
      stmt.bindString(4, tokenType);
    }

    String refreshToken = entity.getRefreshToken();
    if (refreshToken != null) {
      stmt.bindString(5, refreshToken);
    }

    String accessToken = entity.getAccessToken();
    if (accessToken != null) {
      stmt.bindString(6, accessToken);
    }
  }
Esempio n. 2
0
 /** @inheritdoc */
 @Override
 public Long getKey(TokensBD entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }