本文整理汇总了Java中android.database.sqlite.SQLiteQueryBuilder.appendWhereEscapeString方法的典型用法代码示例。如果您正苦于以下问题:Java SQLiteQueryBuilder.appendWhereEscapeString方法的具体用法?Java SQLiteQueryBuilder.appendWhereEscapeString怎么用?Java SQLiteQueryBuilder.appendWhereEscapeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.database.sqlite.SQLiteQueryBuilder
的用法示例。
在下文中一共展示了SQLiteQueryBuilder.appendWhereEscapeString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor contains all RegisteredActionParameter records which matches the parameters.
*
* @param parameterName
* is the parameter name, or null to fetch any parameterName.
* @param actionID
* is the action id, or null to fetch any actionID.
* @param dataTypeID
* is the dataType id, or null to fetch any dataTypeID.
* @return a Cursor contains all RegisteredActionParameter records which matches the parameters.
*/
public Cursor fetchAll(String parameterName, Long actionID, Long dataTypeID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (parameterName != null) {
qb.appendWhere(" AND " + KEY_ACTIONPARAMETERNAME + " = ");
qb.appendWhereEscapeString(parameterName);
}
if (actionID != null) {
qb.appendWhere(" AND " + KEY_ACTIONID + " = " + actionID);
}
if (dataTypeID != null) {
qb.appendWhere(" AND " + KEY_DATATYPEID + " = " + dataTypeID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例2: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all DataFilter records which matches the parameters.
*
* @param dataFilterName
* is the filter name or null to fetch any filter name.
*
* @param dataFilterDisplayName
* is the filter display name or null to fetch any filter name.
*
* @param filterOnDataTypeID
* is the id of data type it filters on, or null to fetch any.
*
* @param compareWithDataTypeID
* is the id of data type it compares to, or null to fetch any.
*
* @return a Cursor that contains all DataFilter records which matches the parameters.
*/
public Cursor fetchAll(String dataFilterName, String dataFilterDisplayName,
Long filterOnDataTypeID, Long compareWithDataTypeID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (dataFilterName != null) {
qb.appendWhere(" AND " + KEY_DATAFILTERNAME + " = ");
qb.appendWhereEscapeString(dataFilterName);
}
if (dataFilterDisplayName != null) {
qb.appendWhere(" AND " + KEY_DATAFILTERDISPLAYNAME + " = ");
qb.appendWhereEscapeString(dataFilterDisplayName);
}
if (filterOnDataTypeID != null) {
qb.appendWhere(" AND " + KEY_FILTERONDATATYPEID + " = " + filterOnDataTypeID);
}
if (compareWithDataTypeID != null) {
qb.appendWhere(" AND " + KEY_COMPAREWITHDATATYPEID + " = " + compareWithDataTypeID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例3: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all RegisteredApp records which matches the parameters.
*
* @param appName
* is the application name or null to fetch any appName.
* @param pkgName
* is the package name or null to fetch any pkgName.
* @param enabled
* is whether the application is activated or null to fetch any enabled status.
* @return a Cursor that contains all RegisteredApp records which matches the parameters.
*/
public Cursor fetchAll(String appName, String pkgName, Boolean enabled) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (appName != null) {
qb.appendWhere(" AND " + KEY_APPNAME + " = ");
qb.appendWhereEscapeString(appName);
}
if (pkgName != null) {
qb.appendWhere(" AND " + KEY_PKGNAME + " = ");
qb.appendWhereEscapeString(pkgName);
}
if (enabled != null) {
qb.appendWhere(" AND " + KEY_ENABLED + " = " + (enabled ? 1 : 0));
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例4: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor contains all RegisteredEventAttribute records which matches the parameters.
*
* @param attributeName
* is the attribute name, or null to fetch any attributeName
* @param eventID
* is the event id, or null to fetch any eventID
* @param dataTypeID
* is the dataType id, or null to fetch any dataTypeID
* @return a Cursor contains all RegisteredEventAttribute records which matches the parameters.
*/
public Cursor fetchAll(String attributeName, Long eventID, Long dataTypeID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (attributeName != null) {
qb.appendWhere(" AND " + KEY_EVENTATTRIBUTENAME + " = ");
qb.appendWhereEscapeString(attributeName);
}
if (eventID != null) {
qb.appendWhere(" AND " + KEY_EVENTID + " = " + eventID);
}
if (dataTypeID != null) {
qb.appendWhere(" AND " + KEY_DATATYPEID + " = " + dataTypeID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例5: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all DataType records which matches the parameters.
*
* @param dataTypeName
* is the data type name or null to fetch any dataTypeName.
* @param dataTypeClassName
* is the name of the data type class.
* @return a Cursor that contains all DataType records which matches the parameters.
*/
public Cursor fetchAll(String dataTypeName, String dataTypeClassName) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (dataTypeName != null) {
qb.appendWhere(" AND " + KEY_DATATYPENAME + " = ");
qb.appendWhereEscapeString(dataTypeName);
}
if (dataTypeClassName != null) {
qb.appendWhere(" AND " + KEY_DATATYPECLASSNAME + " = ");
qb.appendWhereEscapeString(dataTypeClassName);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例6: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all RuleActionParameter records which matches the parameters.
*
* @param ruleActionID
* is id of rule action it belongs to, or null to fetch any
* @param actionParameterID
* is id of its action parameter type, or null to fetch any
* @param ruleActionParameterData
* is the data associated with this parameter, or null to fetch any
* @return a Cursor that contains all RuleActionParameter records which matches the parameters.
*/
public Cursor fetchAll(Long ruleActionID, Long actionParameterID, String ruleActionParameterData) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (ruleActionID != null) {
qb.appendWhere(" AND " + KEY_RULEACTIONID + " = " + ruleActionID);
}
if (actionParameterID != null) {
qb.appendWhere(" AND " + KEY_ACTIONPARAMETERID + " = " + actionParameterID);
}
if (ruleActionParameterData != null) {
qb.appendWhere(" AND " + KEY_RULEACTIONPARAMETERDATA + " = ");
qb.appendWhereEscapeString(ruleActionParameterData);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例7: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all Rule records which matches the parameters.
*
* @param eventID
* is the event id, or null to fetch any eventID
* @param ruleName
* is name of rule, or null to fetch any ruleName
* @param ruleDesc
* is description of rule, or null to fetch any description
* @param enabled
* is whether the rule is activated or null to fetch any enabled status
* @param orderBy
* is the ',' delimited order by columns, or null if no specific order
* @return a Cursor that contains all Rule records which matches the parameters.
* @throws SQLiteException
* if orderBy is not compiled correctly
*/
public Cursor fetchAll(Long eventID, String ruleName, String ruleDesc, Boolean enabled,
String orderBy) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (eventID != null) {
qb.appendWhere(" AND " + KEY_EVENTID + " = " + eventID);
}
if (ruleName != null) {
qb.appendWhere(" AND " + KEY_RULENAME + " = ");
qb.appendWhereEscapeString(ruleName);
}
if (ruleDesc != null) {
qb.appendWhere(" AND " + KEY_RULEDESC + " = ");
qb.appendWhereEscapeString(ruleDesc);
}
if (enabled != null) {
qb.appendWhere(" AND " + KEY_ENABLED + " = " + (enabled ? 1 : 0));
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, orderBy);
}
示例8: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all ExternalAttribute records which matches the parameters
*
* @param attributeName
* is the attribute name, or null to fetch any actionName
* @param appID
* is the application id, or null to fetch any appID
* @param dataTypeID
* is the dataType id, or null to fetch any dataTypeID
* @return a Cursor that contains all RegisteredAction records which matches the parameters.
*/
public Cursor fetchAll(String attributeName, Long appID, Long dataTypeID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (attributeName != null) {
qb.appendWhere(" AND " + KEY_EXTERNALATTRIBUTENAME + " = ");
qb.appendWhereEscapeString(attributeName);
}
if (appID != null) {
qb.appendWhere(" AND " + KEY_APPID + " = " + appID);
}
if (dataTypeID != null) {
qb.appendWhere(" AND " + KEY_DATATYPEID + " = " + dataTypeID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例9: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all FailedActionParameter records which matches the parameters.
*
* @param failedActionID
* is id of failed action it belongs to, or null to fetch any
* @param actionParameterName
* name of action parameter, or null to fetch any
* @param failedActionParameterData
* is the data associated with this parameter, or null to fetch any
* @return a Cursor that contains all FailedActionParameter records which matches the parameters.
*/
public Cursor fetchAll(Long failedActionID, String actionParameterName,
String failedActionParameterData) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (failedActionID != null) {
qb.appendWhere(" AND " + KEY_FAILEDACTIONID + " = " + failedActionID);
}
if (actionParameterName != null) {
qb.appendWhere(" AND " + KEY_ACTIONPARAMETERNAME + " = " + actionParameterName);
}
if (failedActionParameterData != null) {
qb.appendWhere(" AND " + KEY_FAILEDACTIONPARAMETERDATA + " = ");
qb.appendWhereEscapeString(failedActionParameterData);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例10: query
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
@Override
public Cursor query(final Uri uri, final String[] projection, final String selection,
final String[] selectionArgs, final String sortOrder) {
final SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
final List<String> pathSegments = uri.getPathSegments();
if (pathSegments.size() > 2)
throw new IllegalArgumentException(uri.toString());
if (pathSegments.size() == 2) {
final AbstractAddress address = getDepositAddress(uri);
qb.appendWhere(KEY_DEPOSIT_COIN_ID + "=");
qb.appendWhereEscapeString(address.getType().getId());
qb.appendWhere(" AND " + KEY_DEPOSIT_ADDRESS + "=");
qb.appendWhereEscapeString(address.toString());
}
final Cursor cursor = qb.query(helper.getReadableDatabase(), projection,
selection, selectionArgs, null, null, sortOrder);
cursor.setNotificationUri(getContext().getContentResolver(), uri);
return cursor;
}
示例11: appendAddresses
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
private static void appendAddresses(final SQLiteQueryBuilder qb, final String[] addresses) {
for (final String address : addresses) {
qb.appendWhereEscapeString(address.trim());
if (!address.equals(addresses[addresses.length - 1]))
qb.appendWhere(",");
}
}
示例12: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all RuleFilter records which matches the parameters.
*
* @param ruleID
* is the id of rule the filter belongs to, or null to fetch any.
* @param eventAttributeID
* is id of the event attribute, or null to fetch any.
* @param externalAttributeID
* is id of the external attribute, or null to fetch any.
* @param dataFilterID
* is id of the data filter, or null to fetch any.
* @param parentRuleFilterID
* is id of its parent ruleFiler, or null to fetch any.
* @param ruleFilterData
* is the data associated with this ruleFilter, or null to fetch any.
* @return a Cursor that contains all RuleFilter records which matches the parameters.
*/
public Cursor fetchAll(Long ruleID, Long eventAttributeID, Long externalAttributeID,
Long dataFilterID, Long parentRuleFilterID, String ruleFilterData) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (ruleID != null) {
qb.appendWhere(" AND " + KEY_RULEID + " = " + ruleID);
}
if (eventAttributeID != null) {
qb.appendWhere(" AND " + KEY_EVENTATTRIBUTEID + " = " + eventAttributeID);
}
if (externalAttributeID != null) {
qb.appendWhere(" AND " + KEY_EXTERNALATTRIBUTEID + " = " + externalAttributeID);
}
if (dataFilterID != null) {
qb.appendWhere(" AND " + KEY_DATAFILTERID + " = " + dataFilterID);
}
if (parentRuleFilterID != null) {
qb.appendWhere(" AND " + KEY_PARENTRULEFILTERID + " = " + parentRuleFilterID);
}
if (ruleFilterData != null) {
qb.appendWhere(" AND " + KEY_RULEFILTERDATA + " = ");
qb.appendWhereEscapeString(ruleFilterData);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例13: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all RegisteredAction records which matches the parameters
*
* @param actionName
* is the actionName, or null to fetch any actionName
* @param appID
* is the application id, or null to fetch any appID
* @return a Cursor that contains all RegisteredAction records which matches the parameters.
*/
public Cursor fetchAll(String actionName, Long appID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (actionName != null) {
qb.appendWhere(" AND " + KEY_ACTIONNAME + " = ");
qb.appendWhereEscapeString(actionName);
}
if (appID != null) {
qb.appendWhere(" AND " + KEY_APPID + " = " + appID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例14: fetchAll
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
/**
* Return a Cursor that contains all RegisteredEvent records which matches the parameters.
*
* @param eventName
* is the event name, or null to fetch any eventName
* @param appID
* is the application id, or null to fetch any appID
* @return a Cursor that contains all RegisteredEvent records which matches the parameters.
*/
public Cursor fetchAll(String eventName, Long appID) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(DATABASE_TABLE);
qb.appendWhere("1=1");
if (eventName != null) {
qb.appendWhere(" AND " + KEY_EVENTNAME + " = ");
qb.appendWhereEscapeString(eventName);
}
if (appID != null) {
qb.appendWhere(" AND " + KEY_APPID + " = " + appID);
}
// Not using additional selections, selectionArgs, groupBy, having, orderBy, set them to null.
return qb.query(database, KEYS, null, null, null, null, null);
}
示例15: appendAddresses
import android.database.sqlite.SQLiteQueryBuilder; //导入方法依赖的package包/类
private static void appendAddresses(@Nonnull final SQLiteQueryBuilder qb, @Nonnull final String[] addresses) {
for (final String address : addresses) {
qb.appendWhereEscapeString(address.trim());
if (!address.equals(addresses[addresses.length - 1]))
qb.appendWhere(",");
}
}