0

メソッドのDaorefresh()のJavadocは次のようになります。

スロー:SQLException-SQLの問題、データアイテムがテーブルに見つからない場合、またはデータのIDで複数のアイテムが見つかった場合。

ただし、クラスcom.j256.ormlite.stmt.mapped.MappedRefreshには別のJavadoc定義があり、更新してユーザーに戻るまで結果コードを返します。

/**
 * Execute our refresh query statement and then update all of the fields in data with the fields from the result.
 * 
 * @return 1 if we found the object in the table by id or 0 if not.
 */
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache)
        throws SQLException {
    @SuppressWarnings("unchecked")
    ID id = (ID) idField.extractJavaFieldValue(data);
    // we don't care about the cache here
    T result = super.execute(databaseConnection, id, null);
    if (result == null) {
        return 0;
    }
    // copy each field from the result into the passed in object
    for (FieldType fieldType : resultsFieldTypes) {
        if (fieldType != idField) {
            fieldType.assignField(data, fieldType.extractJavaFieldValue(result), false, objectCache);
        }
    }
    return 1;
}

これはバグですか、それともDao.refreshのJavadocの間違いですか?

OrmLite4.41を見ています。

4

1 に答える 1