Java Code Examples for com.raizlabs.android.dbflow.structure.database.DatabaseWrapper#compileStatement()

The following examples show how to use com.raizlabs.android.dbflow.structure.database.DatabaseWrapper#compileStatement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseQueriable.java    From Meteorite with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public DatabaseStatement compileStatement(@NonNull DatabaseWrapper databaseWrapper) {
    String query = getQuery();
    FlowLog.log(FlowLog.Level.V, "Compiling Query Into Statement: " + query);
    return new DatabaseStatementWrapper<>(databaseWrapper.compileStatement(query), this);
}
 
Example 2
Source File: SqlUtils.java    From Meteorite with Apache License 2.0 5 votes vote down vote up
public static long longForQuery(@NonNull DatabaseWrapper wrapper,
                                @NonNull String query) {
    DatabaseStatement statement = wrapper.compileStatement(query);
    try {
        return statement.simpleQueryForLong();
    } finally {
        statement.close();
    }
}
 
Example 3
Source File: ModelAdapter.java    From Meteorite with Apache License 2.0 2 votes vote down vote up
/**
 * @param databaseWrapper The database used to do an insert statement.
 * @return a new compiled {@link DatabaseStatement} representing insert. Not cached, always generated.
 * To bind values use {@link #bindToInsertStatement(DatabaseStatement, Object)}.
 */
@NonNull
public DatabaseStatement getInsertStatement(@NonNull DatabaseWrapper databaseWrapper) {
    return databaseWrapper.compileStatement(getInsertStatementQuery());
}
 
Example 4
Source File: ModelAdapter.java    From Meteorite with Apache License 2.0 2 votes vote down vote up
/**
 * @param databaseWrapper The database used to do an update statement.
 * @return a new compiled {@link DatabaseStatement} representing update. Not cached, always generated.
 * To bind values use {@link #bindToUpdateStatement(DatabaseStatement, Object)}.
 */
@NonNull
public DatabaseStatement getUpdateStatement(@NonNull DatabaseWrapper databaseWrapper) {
    return databaseWrapper.compileStatement(getUpdateStatementQuery());
}
 
Example 5
Source File: ModelAdapter.java    From Meteorite with Apache License 2.0 2 votes vote down vote up
/**
 * @param databaseWrapper The database used to do a delete statement.
 * @return a new compiled {@link DatabaseStatement} representing delete. Not cached, always generated.
 * To bind values use {@link #bindToDeleteStatement(DatabaseStatement, Object)}.
 */
@NonNull
public DatabaseStatement getDeleteStatement(@NonNull DatabaseWrapper databaseWrapper) {
    return databaseWrapper.compileStatement(getDeleteStatementQuery());
}
 
Example 6
Source File: ModelAdapter.java    From Meteorite with Apache License 2.0 2 votes vote down vote up
/**
 * @param databaseWrapper The database used to do an insert statement.
 * @return a new compiled {@link DatabaseStatement} representing insert.
 * To bind values use {@link #bindToInsertStatement(DatabaseStatement, Object)}.
 */
public DatabaseStatement getCompiledStatement(@NonNull DatabaseWrapper databaseWrapper) {
    return databaseWrapper.compileStatement(getCompiledStatementQuery());
}