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

项目: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);
}
项目:spring-data-dynamodb    文件:DynamoDBHashAndRangeKeyExtractingEntityMetadataImpl.java   
public DynamoDBHashAndRangeKeyExtractingEntityMetadataImpl(final Class<T> domainType) {
    super(domainType);
    this.hashAndRangeKeyMethodExtractor = new DynamoDBHashAndRangeKeyMethodExtractorImpl<T>(getJavaType());
    ReflectionUtils.doWithMethods(domainType, new MethodCallback() {
        public void doWith(Method method) {
            if (method.getAnnotation(DynamoDBHashKey.class) != null) {
                String setterMethodName = toSetterMethodNameFromAccessorMethod(method);
                if (setterMethodName != null) {
                    hashKeySetterMethod = ReflectionUtils.findMethod(domainType, setterMethodName, method.getReturnType());
                }
            }
        }
    });
    ReflectionUtils.doWithFields(domainType, new FieldCallback() {
        public void doWith(Field field) {
            if (field.getAnnotation(DynamoDBHashKey.class) != null) {

                hashKeyField = ReflectionUtils.findField(domainType, field.getName());

            }
        }
    });
    Assert.isTrue(hashKeySetterMethod != null || hashKeyField != null, "Unable to find hash key field or setter method on " + domainType + "!");
    Assert.isTrue(hashKeySetterMethod == null || hashKeyField == null, "Found both hash key field and setter method on " + domainType + "!");

}
项目:aws-dynamodb-encryption-java    文件:MapperQueryExpressionCryptoTest.java   
@DynamoDBHashKey
@DynamoDBIndexHashKey (
        globalSecondaryIndexNames = {
                "GSI-primary-hash-index-range-1",
                "GSI-primary-hash-index-range-2"}
)
public String getPrimaryHashKey() {
    return primaryHashKey;
}
项目: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;

    }
项目:alexa-skill-java    文件:Person.java   
@DynamoDBHashKey
public String getId() {
    return id;
}
项目:qpp-conversion-tool    文件:Metadata.java   
/**
 * The UUID that uniquely identifies this item.
 *
 * @return The UUID.
 */
@DynamoDBHashKey(attributeName = "Uuid")
@DynamoDBAutoGeneratedKey
public String getUuid() {
    return uuid;
}
项目:dynamodb-java-helloworld    文件:Book.java   
@DynamoDBHashKey
public String getId() {
    return id;
}
项目:aws-amazon-shopping-bot-lambda-func    文件:Order.java   
@DynamoDBHashKey(attributeName = "order_id")
public String getOrderId() {
    return orderId;
}
项目:aws-amazon-shopping-bot-lambda-func    文件:Product.java   
@DynamoDBHashKey(attributeName = "product_id")
public String getProductId() {
    return productId;
}
项目:aws-amazon-shopping-bot-lambda-func    文件:User.java   
@DynamoDBHashKey(attributeName="user_id")
public String getUserId() {
    return userId;
}
项目:aws-amazon-shopping-bot-lambda-func    文件:ShoppingCart.java   
@Override
@DynamoDBHashKey(attributeName = "user_id")
public String getUserId() {
    return super.getUserId();
}
项目:Java-9-Programming-Blueprints    文件:Recipient.java   
@DynamoDBHashKey(attributeName = "_id")
public String getId() {
    return id;
}
项目:plano    文件:DynamoDBPlanoRequest.java   
@DynamoDBAutoGeneratedKey
@DynamoDBHashKey(attributeName = "RequestID")
public String getRequestID() {
    return requestID;
}
项目:serverless    文件:Book.java   
@DynamoDBHashKey
public String getId() {
    return id;
}
项目:duckdns    文件:Domain.java   
@DynamoDBHashKey
public String getDomainName() { return domainName; }
项目:duckdns    文件:Session.java   
@DynamoDBHashKey
public String getJsessionId() { return jsessionId; }
项目:duckdns    文件:Account.java   
@DynamoDBHashKey
public String getEmail() {
    return email;
}
项目:duckdns    文件:Domain.java   
@DynamoDBHashKey
public String getDomainName() { return domainName; }
项目:duckdns    文件:Session.java   
@DynamoDBHashKey
public String getJsessionId() { return jsessionId; }
项目:duckdns    文件:Account.java   
@DynamoDBHashKey
public String getEmail() { return email; }
项目:duckdns    文件:Domain.java   
@DynamoDBHashKey
public String getDomainName() { return domainName; }
项目:enhanced-snapshots    文件:BackupEntry.java   
@DynamoDBHashKey()
public String getFileName() {
    return fileName;
}
项目:enhanced-snapshots    文件:Configuration.java   
@DynamoDBHashKey()
public String getConfigurationId() {
    return configurationId;
}
项目:nfscan    文件:ElectronicTaxReceiptArchive.java   
@DynamoDBHashKey(attributeName = "electronictaxreceiptarchive_id")
public String getId() {
    return id;
}
项目:nfscan    文件:ElectronicTaxReceipt.java   
@DynamoDBAutoGeneratedKey()
@DynamoDBHashKey(attributeName = "electronictaxreceipt_id")
public String getId() {
    return id;
}
项目:nfscan    文件:TaxReceiptArchive.java   
@DynamoDBHashKey(attributeName = "taxreceiptarchive_id")
public String getId() {
    return id;
}
项目:nfscan    文件:TaxReceipt.java   
@DynamoDBAutoGeneratedKey()
@DynamoDBHashKey(attributeName = "taxreceipt_id")
public String getId() {
    return id;
}
项目:mobilecloud-15    文件:Video.java   
@DynamoDBHashKey
@DynamoDBAutoGeneratedKey
public String getId() {
    return id;
}
项目:mobilecloud-15    文件:Video.java   
@DynamoDBHashKey
@DynamoDBAutoGeneratedKey
public String getId() {
    return id;
}
项目:ReCiter    文件:ESearchResult.java   
@DynamoDBHashKey(attributeName = "uid")
public String getUid() {
    return uid;
}
项目:ReCiter    文件:Identity.java   
@DynamoDBHashKey(attributeName = "uid")
public String getUid() {
    return uid;
}
项目:ReCiter    文件:ScopusArticle.java   
@DynamoDBHashKey(attributeName = "id")
public String getId() {
    return id;
}
项目:ReCiter    文件:MeshTerm.java   
@DynamoDBHashKey(attributeName = "mesh")
public String getMesh() {
    return mesh;
}
项目:ReCiter    文件:PubMedArticle.java   
@DynamoDBHashKey(attributeName = "pmid")
public Long getPmid() {
    return pmid;
}
项目:ReCiter    文件:InstitutionAfid.java   
@DynamoDBHashKey(attributeName = "institution")
public String getInstitution() {
    return institution;
}
项目:ReCiter    文件:GoldStandard.java   
@DynamoDBHashKey(attributeName = "uid")
public String getUid() {
    return uid;
}
项目:DenunciaMXBackEnd    文件:Dispositivo.java   
@DynamoDBHashKey
public String getToken() {
    return token;
}
项目:DenunciaMXBackEnd    文件:Usuario.java   
@DynamoDBHashKey
public String getToken() {
    return token;
}
项目:DenunciaMXBackEnd    文件:DenunciaHistory.java   
@DynamoDBHashKey
public String getIdHistoria() {
    return idHistoria;
}