Example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBScanExpression getScanFilter

List of usage examples for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBScanExpression getScanFilter

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBScanExpression getScanFilter.

Prototype

public Map<String, Condition> getScanFilter() 

Source Link

Document

Returns the scan filter as a map of attribute names to conditions.

Usage

From source file:com.makariev.dynamodb.preferences.UserPreferenceLowLevelAPIService.java

License:Open Source License

@Override
public List<UserPreference> scanByFirstName(String searchForName) {
    final DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
    scanExpression.addFilterCondition("firstName",
            new Condition().withComparisonOperator(ComparisonOperator.CONTAINS)
                    .withAttributeValueList(new AttributeValue().withS(searchForName)));
    final Map<String, Condition> scanFilter = scanExpression.getScanFilter();

    final ScanResult scanResult = dynamoDb.scan(UserPreference.TABLE_NAME, scanFilter);

    final List<Map<String, AttributeValue>> items = scanResult.getItems();

    return toUserPreferenceList(items);
}

From source file:com.makariev.dynamodb.preferences.UserPreferenceLowLevelAPIService.java

License:Open Source License

@Override
public List<UserPreference> scanByLastName(String searchForName) {
    final DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
    scanExpression.addFilterCondition("lastName",
            new Condition().withComparisonOperator(ComparisonOperator.CONTAINS)
                    .withAttributeValueList(new AttributeValue().withS(searchForName)));
    final Map<String, Condition> scanFilter = scanExpression.getScanFilter();

    final ScanResult scanResult = dynamoDb.scan(UserPreference.TABLE_NAME, scanFilter);

    final List<Map<String, AttributeValue>> items = scanResult.getItems();

    return toUserPreferenceList(items);
}