当前位置: 首页>>代码示例>>Java>>正文


Java DynamoDBHashKey类代码示例

本文整理汇总了Java中com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey的典型用法代码示例。如果您正苦于以下问题:Java DynamoDBHashKey类的具体用法?Java DynamoDBHashKey怎么用?Java DynamoDBHashKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DynamoDBHashKey类属于com.amazonaws.services.dynamodbv2.datamodeling包,在下文中一共展示了DynamoDBHashKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTable

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
/***
 * 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;
}
 
开发者ID:shagwood,项目名称:micro-genie,代码行数:31,代码来源:DynamoAdmin.java

示例2: shouldCreatePersistentEntityFor

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@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);
}
 
开发者ID:michaellavelle,项目名称:spring-data-dynamodb,代码行数:22,代码来源:DynamoDBMappingContext.java

示例3: DynamoDBHashAndRangeKeyExtractingEntityMetadataImpl

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
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 + "!");

}
 
开发者ID:michaellavelle,项目名称:spring-data-dynamodb,代码行数:27,代码来源:DynamoDBHashAndRangeKeyExtractingEntityMetadataImpl.java

示例4: getUuid

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
/**
 * The UUID that uniquely identifies this item.
 *
 * @return The UUID.
 */
@DynamoDBHashKey(attributeName = "Uuid")
@DynamoDBAutoGeneratedKey
public String getUuid() {
	return uuid;
}
 
开发者ID:CMSgov,项目名称:qpp-conversion-tool,代码行数:11,代码来源:Metadata.java

示例5: getPrimaryHashKey

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey
@DynamoDBIndexHashKey (
        globalSecondaryIndexNames = {
                "GSI-primary-hash-index-range-1",
                "GSI-primary-hash-index-range-2"}
)
public String getPrimaryHashKey() {
    return primaryHashKey;
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-encryption-java,代码行数:10,代码来源:MapperQueryExpressionCryptoTest.java

示例6: getOverriddenAttributeName

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
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;

	}
 
开发者ID:michaellavelle,项目名称:spring-data-dynamodb,代码行数:32,代码来源:DynamoDBEntityMetadataSupport.java

示例7: getId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey
public String getId() {
    return id;
}
 
开发者ID:arun-gupta,项目名称:alexa-skill-java,代码行数:5,代码来源:Person.java

示例8: getId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey
public String getId() {
	return id;
}
 
开发者ID:arun-gupta,项目名称:dynamodb-java-helloworld,代码行数:5,代码来源:Book.java

示例9: getOrderId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey(attributeName = "order_id")
public String getOrderId() {
    return orderId;
}
 
开发者ID:satr,项目名称:aws-amazon-shopping-bot-lambda-func,代码行数:5,代码来源:Order.java

示例10: getProductId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey(attributeName = "product_id")
public String getProductId() {
    return productId;
}
 
开发者ID:satr,项目名称:aws-amazon-shopping-bot-lambda-func,代码行数:5,代码来源:Product.java

示例11: getUserId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey(attributeName="user_id")
public String getUserId() {
    return userId;
}
 
开发者ID:satr,项目名称:aws-amazon-shopping-bot-lambda-func,代码行数:5,代码来源:User.java

示例12: getUserId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@Override
@DynamoDBHashKey(attributeName = "user_id")
public String getUserId() {
    return super.getUserId();
}
 
开发者ID:satr,项目名称:aws-amazon-shopping-bot-lambda-func,代码行数:6,代码来源:ShoppingCart.java

示例13: getId

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey(attributeName = "_id")
public String getId() {
    return id;
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:5,代码来源:Recipient.java

示例14: getRequestID

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBAutoGeneratedKey
@DynamoDBHashKey(attributeName = "RequestID")
public String getRequestID() {
    return requestID;
}
 
开发者ID:milton0825,项目名称:plano,代码行数:6,代码来源:DynamoDBPlanoRequest.java

示例15: getDomainName

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; //导入依赖的package包/类
@DynamoDBHashKey
public String getDomainName() { return domainName; }
 
开发者ID:tahamsaglam,项目名称:duckdns,代码行数:3,代码来源:Domain.java


注:本文中的com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。