urbanairship-core/src/main/java/com/urbanairship/remotedata/RemoteDataPayloadEntry.java
@WorkerThread
    boolean save(SQLiteDatabase database) {
        if (id == -1) {
            ContentValues value = new ContentValues();
            value.put(COLUMN_NAME_TYPE, type);
            value.put(COLUMN_NAME_TIMESTAMP, timestamp);
            value.put(COLUMN_NAME_DATA, data);

            id = database.insert(TABLE_NAME, null, value);
            if (id != -1) {
                isDirty = false;
                return true;
            }
        } else if (isDirty) {
            ContentValues value = new ContentValues();

            if (database.updateWithOnConflict(TABLE_NAME, value, COLUMN_NAME_ID + " = ?", new String[] { String.valueOf(id) }, SQLiteDatabase.CONFLICT_REPLACE) != 0) {
                isDirty = false;
                return true;
            } else {
                return false;
            }
        }

        return true;
    }
/**
     * Saves to a database.
     *
     * @param database The database.
     * @return A boolean indicating success.
     */
Saves to a database.
@param database The database.
@return A boolean indicating success.
Saves to a database . @param database The database . @return A boolean indicating success .
@WorkerThread
    boolean save(SQLiteDatabase database) {
        if (id == -1) {
            ContentValues value = new ContentValues();
            value.put(COLUMN_NAME_TYPE, type);
            value.put(COLUMN_NAME_TIMESTAMP, timestamp);
            value.put(COLUMN_NAME_DATA, data);
            id = database.insert(TABLE_NAME, null, value);
            if (id != -1) {
                isDirty = false;
                return true;
            }
        } else if (isDirty) {
            ContentValues value = new ContentValues();
            if (database.updateWithOnConflict(TABLE_NAME, value, COLUMN_NAME_ID + " = ?", new String[] { String.valueOf(id) }, SQLiteDatabase.CONFLICT_REPLACE) != 0) {
                isDirty = false;
                return true;
            } else {
                return false;
            }
        }
        return true;
    }
@ WorkerThread boolean save ( SQLiteDatabase database ) { if ( id == - 1 ) { ContentValues value = new ContentValues ( ) ; value . put ( COLUMN_NAME_TYPE , type ) ; value . put ( COLUMN_NAME_TIMESTAMP , timestamp ) ; value . put ( COLUMN_NAME_DATA , data ) ; id = database . insert ( TABLE_NAME , null , value ) ; if ( id != - 1 ) { isDirty = false ; return true ; } } else if ( isDirty ) { ContentValues value = new ContentValues ( ) ; if ( database . updateWithOnConflict ( TABLE_NAME , value , COLUMN_NAME_ID + " = ?" , new String [ ] { String . valueOf ( id ) } , SQLiteDatabase . CONFLICT_REPLACE ) != 0 ) { isDirty = false ; return true ; } else { return false ; } } return true ; }
Saves to a database.
Saves to a database .