本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.Condition.setComparisonOperator方法的典型用法代码示例。如果您正苦于以下问题:Java Condition.setComparisonOperator方法的具体用法?Java Condition.setComparisonOperator怎么用?Java Condition.setComparisonOperator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.dynamodbv2.model.Condition
的用法示例。
在下文中一共展示了Condition.setComparisonOperator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCondition
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
@Override
public Condition createCondition() {
Condition condition = new Condition();
condition.setComparisonOperator(operator.getDynamoDBName());
List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
attributeValueList.add(HiveDynamoDBTypeFactory.getTypeObjectFromHiveType(columnType)
.getAttributeValue(columnValue));
condition.setAttributeValueList(attributeValueList);
return condition;
}
示例2: createCondition
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
@Override
public Condition createCondition() {
Condition condition = new Condition();
condition.setComparisonOperator(operator.getDynamoDBName());
List<AttributeValue> attributeValueList = new ArrayList<>();
for (String value : columnValues) {
attributeValueList.add(HiveDynamoDBTypeFactory.getTypeObjectFromHiveType(columnType)
.getAttributeValue(value));
}
condition.setAttributeValueList(attributeValueList);
return condition;
}
示例3: getBooksFromLibrary
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
public List<Book> getBooksFromLibrary(final String libraryId, final String isbn){
final Book book = new Book();
book.setIsbn(isbn);
book.setLibraryId(libraryId);
final Condition condition = new Condition();
condition.setComparisonOperator(ComparisonOperator.EQ);
final List<Book> books = this.mapper.queryIndexHashAndRangeKey(Book.class, book, Book.GLOBAL_INDEX_LIBRARY_ISBN, "libraryId", condition, DEFAULT_PAGE_LIMIT);
return books;
}
示例4: getBooksByIsbnAndStatus
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
/***
* Get books by ISBN and Status
* @param isbn
* @param status
* @return bookList
*/
public List<Book> getBooksByIsbnAndStatus(final String isbn, final String status){
final Book book = new Book();
book.setIsbn(isbn);
book.setStatus(status);
final Condition condition = new Condition();
condition.setComparisonOperator(ComparisonOperator.EQ);
final List<Book> books = this.mapper.queryIndexHashKey(Book.class, book, Book.GLOBAL_INDEX_ISBN_STATUS, DEFAULT_PAGE_LIMIT);
return books;
}
示例5: createCondition
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
@Override
public Condition createCondition() {
Condition condition = new Condition();
condition.setComparisonOperator(operator.getDynamoDBName());
return condition;
}
示例6: visit
import com.amazonaws.services.dynamodbv2.model.Condition; //导入方法依赖的package包/类
@Override
public Object visit(Operation<?> expr, DynamoDBScanExpression scanExpression) {
Operator op = expr.getOperator();
Condition condition = new Condition();
if (op == Ops.EQ) {
condition.setComparisonOperator(ComparisonOperator.EQ);
} else if (op == Ops.STARTS_WITH) {
condition.setComparisonOperator(ComparisonOperator.BEGINS_WITH);
} else if (op == Ops.BETWEEN) {
condition.setComparisonOperator(ComparisonOperator.BETWEEN);
} else if (op == Ops.STRING_CONTAINS) {
condition.setComparisonOperator(ComparisonOperator.CONTAINS);
} else if (op == Ops.GOE) {
condition.setComparisonOperator(ComparisonOperator.GE);
} else if (op == Ops.GT) {
condition.setComparisonOperator(ComparisonOperator.GT);
} else if (op == Ops.LT) {
condition.setComparisonOperator(ComparisonOperator.LT);
} else if (op == Ops.LOE) {
condition.setComparisonOperator(ComparisonOperator.LE);
} else if (op == Ops.IN) {
condition.setComparisonOperator(ComparisonOperator.IN);
} else if (op == Ops.NE) {
condition.setComparisonOperator(ComparisonOperator.NE);
} else if (op == Ops.IS_NULL) {
condition.setComparisonOperator(ComparisonOperator.NULL);
} else if (op == Ops.IS_NOT_NULL) {
condition.setComparisonOperator(ComparisonOperator.NOT_NULL);
} else if (op == Ops.NOT) {
Expression<?> arg = expr.getArg(0);
if (arg instanceof BooleanOperation) {
Operator subOp = ((BooleanOperation) arg).getOperator();
if (subOp == Ops.STRING_CONTAINS) {
condition.setComparisonOperator(ComparisonOperator.NOT_CONTAINS);
expr = (Operation<?>) arg;
} else {
throw new UnsupportedOperationException(String.valueOf(op));
}
} else {
throw new UnsupportedOperationException(String.valueOf(op));
}
} else if (op == Ops.AND) {
List<Expression<?>> args = expr.getArgs();
for (Expression<?> expression : args) {
expression.accept(this, scanExpression);
}
return null;
} else {
throw new UnsupportedOperationException(String.valueOf(op));
}
populateScanExpression(expr.getArgs(), condition, scanExpression);
return condition;
}