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

项目: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;
}
项目:spring-data-dynamodb    文件:DynamoDBMappingContext.java   
@Override
protected boolean shouldCreatePersistentEntityFor(TypeInformation<?> type) {

    boolean hasHashKey = false;
    boolean hasRangeKey = false;
    for (Method method : type.getType().getMethods()) {
        if (method.isAnnotationPresent(DynamoDBHashKey.class))
            hasHashKey = true;
        if (method.isAnnotationPresent(DynamoDBRangeKey.class))
            hasRangeKey = true;

    }
    for (Field field : type.getType().getFields()) {
        if (field.isAnnotationPresent(DynamoDBHashKey.class))
            hasHashKey = true;
        if (field.isAnnotationPresent(DynamoDBRangeKey.class))
            hasRangeKey = true;

    }
    return type.getType().isAnnotationPresent(DynamoDBTable.class) || (hasHashKey && hasRangeKey);
}
项目:querydsl-contrib    文件:DynamodbSerializer.java   
@Override
public Object visit(Path<?> expr, DynamoDBScanExpression scanExpression) {
    AnnotatedElement element = expr.getAnnotatedElement();
    Annotation[] annotations = element.getAnnotations();
    for (Annotation annotation : annotations) {
        if (annotation instanceof DynamoDBRangeKey) {
            return expr.getMetadata().getElement();
        }
    }

    return expr.getMetadata().getElement();
}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBRangeKey
@DynamoDBIndexRangeKey (
        globalSecondaryIndexNames = {"GSI-index-hash-primary-range"},
        localSecondaryIndexName = "LSI-primary-range"
)
public String getPrimaryRangeKey() {
    return primaryRangeKey;
}
项目: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;

    }
项目:aws-dynamodb-encryption-java    文件:IndexRangeKeyTestClass.java   
@DynamoDBRangeKey
public double getRangeKey() {
    return rangeKey;
}
项目:aws-dynamodb-encryption-java    文件:CrossSDKVerificationTestClass.java   
@DynamoDBRangeKey
public String getRangeKey() {
    return rangeKey;
}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBRangeKey
public String getPrimaryRangeKey() {
    return primaryRangeKey;
}
项目:aws-dynamodb-encryption-java    文件:RangeKeyTestClass.java   
@DynamoDBRangeKey
public double getRangeKey() {
    return rangeKey;
}
项目:aws-dynamodb-encryption-java    文件:BaseClass.java   
@DynamoDBRangeKey
public int getRangeKey() {
    return rangeKey;
}
项目:aws-dynamodb-encryption-java    文件:KeysOnly.java   
@DynamoDBRangeKey
public int getRangeKey() {
    return rangeKey;
}
项目:micro-genie    文件:DatabaseExamples.java   
@DynamoDBRangeKey(attributeName="bookId")
public String getBookId() {
    return bookId;
}
项目:gora    文件:Person.java   
@DynamoDBRangeKey(attributeName="date") 
public String getRangeKey() { return date; }
项目:Fancraft    文件:Post.java   
@DynamoDBRangeKey(attributeName="PostTimestamp")
@DynamoDBIndexRangeKey(globalSecondaryIndexNames={"CraftId-PostTimestamp-index","FandomId-PostTimestamp-index"}, attributeName="PostTimestamp")
public String getPosttimestamp() {
    return posttimestamp;
}
项目:Fancraft    文件:Comment.java   
@DynamoDBRangeKey(attributeName="CommentTimestamp")
public String getCommentTimestamp() {
    return commentTimestamp;
}
项目:spring-data-dynamodb-demo    文件:ThreadId.java   
@DynamoDBRangeKey
public String getSubject() {
    return subject;
}
项目:spring-data-dynamodb-demo    文件:Thread.java   
@DynamoDBRangeKey(attributeName = "Subject")
public String getSubject() {
    return threadId != null ? threadId.getSubject() : null;
}
项目:spring-data-dynamodb-demo    文件:ReplyId.java   
@DynamoDBRangeKey
public String getReplyDateTime() {
    return replyDateTime;
}
项目:spring-data-dynamodb-demo    文件:Reply.java   
@DynamoDBRangeKey(attributeName = "ReplyDateTime")
public String getReplyDateTime() {
    return replyId != null ? replyId.getReplyDateTime() : null;
}
项目:aws-dynamodb-examples    文件:ObjectPersistenceQueryScanExample.java   
@DynamoDBRangeKey(attributeName="ReplyDateTime")
public String getReplyDateTime() { return replyDateTime; }
项目:aws-dynamodb-examples    文件:ObjectPersistenceQueryScanExample.java   
@DynamoDBRangeKey(attributeName="Subject")
public String getSubject() { return subject; }
项目:aws-dynamodb-examples    文件:ObjectPersistenceBatchWriteExample.java   
@DynamoDBRangeKey(attributeName="ReplyDateTime")
public String getReplyDateTime() { return replyDateTime; }
项目:aws-dynamodb-examples    文件:ObjectPersistenceBatchWriteExample.java   
@DynamoDBRangeKey(attributeName="Subject")
public String getSubject() { return subject; }
项目: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;

}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKey.java   
@DynamoDBRangeKey
public Object getRangeKey() {
    return rangeKey;
}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java   
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java   
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java   
@DynamoDBRangeKey
public String getOtherRangeKey(){  return null;}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java   
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
项目:spring-data-dynamodb    文件:Playlist.java   
@DynamoDBRangeKey(attributeName = "range")
public String getPlaylistName() {
    return playlistId != null ? playlistId.getPlaylistName() : null;
}
项目:spring-data-dynamodb    文件:PlaylistId.java   
@DynamoDBRangeKey
public String getPlaylistName() {
    return playlistName;
}
项目:openhab1-addons    文件:DynamoDBStringItem.java   
@Override
@DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
public Date getTime() {
    return time;
}
项目:openhab1-addons    文件:DynamoDBBigDecimalItem.java   
@Override
@DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
public Date getTime() {
    return time;
}
项目:lambdora    文件:ResourceTriple.java   
/**
 * Get rdfTriple
 *
 * @return rdfTriple
 */
@DynamoDBRangeKey(attributeName = "rdf_triple")
public String getRdfTriple() {
    return rdfTriple;
}