Code example for SQLiteStatement

Methods: bindDouble, bindLong, bindString, clearBindings, executeInsert

0
            deleteWithRelations(payment.getId());
        } 
    } 
 
    public long create(PaymentParticipantRelationKey type) {
        stmtInsertRelation.clearBindings();
        stmtInsertRelation.bindLong(1, type.getPaymentId());
        stmtInsertRelation.bindLong(2, type.getParticipantId());
        stmtInsertRelation.bindLong(3, ConversionUtils.bool2Int(type.isPayer()));
        stmtInsertRelation.bindString(4, type.getAmount().getUnit().getCurrencyCode());
        stmtInsertRelation.bindDouble(5, type.getAmount().getValue());
        return stmtInsertRelation.executeInsert();
    } 
 
    public void update(PaymentReference type) {
        final ContentValues values = new ContentValues();
        values.put(PaymentColumns.DESCRIPTION, ConversionUtils.nullSafe(type.getDescription()));
        values.put(PaymentColumns.CATEGORY, type.getCategory().ordinal());
 
        db.update(
                PaymentTable.TABLE_NAME,