Java 类com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBIndexRangeKey 实例源码

项目:micro-genie    文件:DynamoAdmin.java   
/***
 * Create the table and the associated indexes if it does not already exist
 * @param reflections
 * @param clazz
 */
private CreateTableResult createTable(Class<?> clazz) {

    final String tableName = this.getClassAnnotationValue(clazz, DynamoDBTable.class, String.class, "tableName");

    final Method hashKeyMember = this.getMethodForAnnotation(clazz, DynamoDBHashKey.class);
    final DynamoDBHashKey hashKeyAnno = hashKeyMember.getAnnotation(DynamoDBHashKey.class);
    final String hashKeyName = this.getAnnotationValue(hashKeyAnno, "attributeName", String.class);
    String rangeKeyName = null;


    final Method rangeKeyMember = this.getMethodForAnnotation(clazz, DynamoDBRangeKey.class);
    if(rangeKeyMember!=null){
        DynamoDBRangeKey rangeKeyAnno = rangeKeyMember.getAnnotation(DynamoDBRangeKey.class);   
        rangeKeyName = this.getAnnotationValue(rangeKeyAnno, "attributeName", String.class);
    }
    final Set<Method> hashKeyIndexFields = this.getMethodsAnnotatedWith(DynamoDBIndexHashKey.class, clazz);
    final Set<Method> rangeKeyIndexFields = this.getMethodsAnnotatedWith(DynamoDBIndexRangeKey.class, clazz);

    final Map<String, GlobalIndex> globalIndexes = this.createGlobalIndexes(hashKeyIndexFields, rangeKeyIndexFields, clazz);
    final Map<String, RangeKeyIndexField> localIndexes = this.createLocalIndexMap(rangeKeyIndexFields);

    final CreateTableRequest tableRequest = this.createCreateTableRequest(tableName, hashKeyName, rangeKeyName, globalIndexes, localIndexes);
    final CreateTableResult result = this.client.createTable(tableRequest);
    return result;
}
项目:aws-dynamodb-encryption-java    文件:IndexRangeKeyTestClass.java   
@DoNotEncrypt
@DynamoDBIndexRangeKey (
        localSecondaryIndexName = "index_foo",
        attributeName = "indexFooRangeKey"
)
public Double getIndexFooRangeKeyWithFakeName() {
    return indexFooRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:IndexRangeKeyTestClass.java   
@DoNotEncrypt
@DynamoDBIndexRangeKey (
        localSecondaryIndexName = "index_bar"
)
public Double getIndexBarRangeKey() {
    return indexBarRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:IndexRangeKeyTestClass.java   
@DoNotEncrypt
@DynamoDBIndexRangeKey (
        localSecondaryIndexNames = {"index_foo_copy", "index_bar_copy"}
)
public Double getMultipleIndexRangeKey() {
    return multipleIndexRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBRangeKey
@DynamoDBIndexRangeKey (
        globalSecondaryIndexNames = {"GSI-index-hash-primary-range"},
        localSecondaryIndexName = "LSI-primary-range"
)
public String getPrimaryRangeKey() {
    return primaryRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBIndexRangeKey (
        globalSecondaryIndexNames = {
                "GSI-primary-hash-index-range-1",
                "GSI-index-hash-index-range-1",
                "GSI-index-hash-index-range-2"},
        localSecondaryIndexNames = {"LSI-index-range-1", "LSI-index-range-2"}
)
public String getIndexRangeKey() {
    return indexRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBIndexRangeKey (
        localSecondaryIndexName = "LSI-index-range-3",
        globalSecondaryIndexName = "GSI-primary-hash-index-range-2"
)
public String getAnotherIndexRangeKey() {
    return anotherIndexRangeKey;
}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyExtractingEntityMetadataImpl.java   
@Override
public Set<String> getIndexRangeKeyPropertyNames() {
    final Set<String> propertyNames = new HashSet<String>();
    ReflectionUtils.doWithMethods(getJavaType(), new MethodCallback() {
        public void doWith(Method method) {
            if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null) {
                if ((method.getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexName() != null && method
                        .getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexName().trim().length() > 0)
                        || (method.getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexNames() != null && method
                                .getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexNames().length > 0)) {
                    propertyNames.add(getPropertyNameForAccessorMethod(method));
                }
            }
        }
    });
    ReflectionUtils.doWithFields(getJavaType(), new FieldCallback() {
        public void doWith(Field field) {
            if (field.getAnnotation(DynamoDBIndexRangeKey.class) != null) {
                if ((field.getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexName() != null && field
                        .getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexName().trim().length() > 0)
                        || (field.getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexNames() != null && field
                                .getAnnotation(DynamoDBIndexRangeKey.class).localSecondaryIndexNames().length > 0)) {
                    propertyNames.add(getPropertyNameForField(field));
                }
            }
        }
    });
    return propertyNames;
}
项目:spring-data-dynamodb    文件:DynamoDBEntityMetadataSupport.java   
public String getOverriddenAttributeName(Method method) {

        if (method != null) {
            if (method.getAnnotation(DynamoDBAttribute.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBAttribute.class).attributeName())) {
                return method.getAnnotation(DynamoDBAttribute.class).attributeName();
            }
            if (method.getAnnotation(DynamoDBHashKey.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBHashKey.class).attributeName())) {
                return method.getAnnotation(DynamoDBHashKey.class).attributeName();
            }
            if (method.getAnnotation(DynamoDBRangeKey.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
                return method.getAnnotation(DynamoDBRangeKey.class).attributeName();
            }
            if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
                return method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
            }
            if (method.getAnnotation(DynamoDBIndexHashKey.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
                return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
            }
            if (method.getAnnotation(DynamoDBVersionAttribute.class) != null
                    && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
                return method.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
            }
        }
        return null;

    }
项目:hn_firebase_listener    文件:HNItemItem.java   
@DynamoDBAttribute(attributeName="time") 
@DynamoDBIndexRangeKey(attributeName="time", globalSecondaryIndexName="by-time-index") 
public long getTime() {return time; }
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBIndexRangeKey(localSecondaryIndexName = "LSI")
public String getLsiRangeKey() {
    return lsiRangeKey;
}
项目:micro-genie    文件:Book.java   
@DynamoDBIndexHashKey(attributeName="isbn", globalSecondaryIndexNames={GLOBAL_INDEX_ISBN})
@DynamoDBIndexRangeKey(attributeName="isbn", globalSecondaryIndexName=GLOBAL_INDEX_LIBRARY_ISBN)
public String getIsbn() {
    return isbn;
}
项目:micro-genie    文件:Book.java   
@DynamoDBIndexHashKey(attributeName="isbn", globalSecondaryIndexNames={GLOBAL_INDEX_ISBN, GLOBAL_INDEX_ISBN_STATUS})
@DynamoDBIndexRangeKey(attributeName="isbn", globalSecondaryIndexNames={GLOBAL_INDEX_LIBRARY_ISBN})
public String getIsbn() {
    return isbn;
}
项目:micro-genie    文件:Book.java   
@DynamoDBIndexRangeKey(attributeName="status", globalSecondaryIndexName=GLOBAL_INDEX_ISBN_STATUS)
public String getStatus() {
    return status;
}
项目:Fancraft    文件:Post.java   
@DynamoDBRangeKey(attributeName="PostTimestamp")
@DynamoDBIndexRangeKey(globalSecondaryIndexNames={"CraftId-PostTimestamp-index","FandomId-PostTimestamp-index"}, attributeName="PostTimestamp")
public String getPosttimestamp() {
    return posttimestamp;
}
项目:spring-data-dynamodb-demo    文件:Thread.java   
@DynamoDBIndexRangeKey(attributeName = "Message")
public String getMessage() {
    return message;
}
项目:spring-data-dynamodb    文件:DynamoDBEntityMetadataSupport.java   
@Override
public String getOverriddenAttributeName(final String propertyName) {

    Method method = findMethod(propertyName);
    if (method != null) {
        if (method.getAnnotation(DynamoDBAttribute.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBAttribute.class).attributeName())) {
            return method.getAnnotation(DynamoDBAttribute.class).attributeName();
        }
        if (method.getAnnotation(DynamoDBHashKey.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBHashKey.class).attributeName())) {
            return method.getAnnotation(DynamoDBHashKey.class).attributeName();
        }
        if (method.getAnnotation(DynamoDBRangeKey.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
            return method.getAnnotation(DynamoDBRangeKey.class).attributeName();
        }
        if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
            return method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
        }
        if (method.getAnnotation(DynamoDBIndexHashKey.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
            return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
        }
        if (method.getAnnotation(DynamoDBVersionAttribute.class) != null
                && StringUtils.isNotEmpty(method.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
            return method.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
        }
    }

    Field field = findField(propertyName);
    if (field != null) {
        if (field.getAnnotation(DynamoDBAttribute.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBAttribute.class).attributeName())) {
            return field.getAnnotation(DynamoDBAttribute.class).attributeName();
        }
        if (field.getAnnotation(DynamoDBHashKey.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBHashKey.class).attributeName())) {
            return field.getAnnotation(DynamoDBHashKey.class).attributeName();
        }
        if (field.getAnnotation(DynamoDBRangeKey.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
            return field.getAnnotation(DynamoDBRangeKey.class).attributeName();
        }
        if (field.getAnnotation(DynamoDBIndexRangeKey.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
            return field.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
        }
        if (field.getAnnotation(DynamoDBIndexHashKey.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
            return field.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
        }
        if (field.getAnnotation(DynamoDBVersionAttribute.class) != null
                && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
            return field.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
        }
    }
    return null;

}