if (indexHashKey != null && !indexHashKey.attributeName().isEmpty()) { return indexHashKey.attributeName();
final DynamoDBIndexHashKey indexHashKey = actualOf(DynamoDBIndexHashKey.class); if (indexHashKey != null) { if (!indexHashKey.globalSecondaryIndexName().isEmpty()) { if (indexHashKey.globalSecondaryIndexNames().length > 0) { throw new DynamoDBMappingException("@DynamoDBIndexHashKey must not specify both HASH GSI name/names"); gsis.put(HASH, Collections.singletonList(indexHashKey.globalSecondaryIndexName())); } else if (indexHashKey.globalSecondaryIndexNames().length > 0) { gsis.put(HASH, Collections.unmodifiableList(Arrays.asList(indexHashKey.globalSecondaryIndexNames()))); } else { throw new DynamoDBMappingException("@DynamoDBIndexHashKey must specify one of HASH GSI name/names");
private String accountIdCluster; @DynamoDBIndexHashKey( attributeName = ENVIRONMENT_CLUSTER_INDEX_HASH_KEY, globalSecondaryIndexName = ENVIRONMENT_CLUSTER_GSI_NAME
private void addGlobalSecondaryIndexNames(Field field, DynamoDBIndexHashKey dynamoDBIndexHashKey) { if (dynamoDBIndexHashKey.globalSecondaryIndexNames() != null && dynamoDBIndexHashKey.globalSecondaryIndexNames().length > 0) { String propertyName = getPropertyNameForField(field); globalSecondaryIndexNames.put(propertyName, field.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexNames()); globalIndexHashKeyPropertyNames.add(propertyName); } if (dynamoDBIndexHashKey.globalSecondaryIndexName() != null && dynamoDBIndexHashKey.globalSecondaryIndexName().trim().length() > 0) { String propertyName = getPropertyNameForField(field); globalSecondaryIndexNames.put(propertyName, new String[]{field.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexName()}); globalIndexHashKeyPropertyNames.add(propertyName); } }
attributeName = indexHashKey.attributeName(); if ( attributeName != null && attributeName.length() > 0 ) return cacheAttributeName(getter, attributeName);
private void addGlobalSecondaryIndexNames(Method method, DynamoDBIndexHashKey dynamoDBIndexHashKey) { if (dynamoDBIndexHashKey.globalSecondaryIndexNames() != null && dynamoDBIndexHashKey.globalSecondaryIndexNames().length > 0) { String propertyName = getPropertyNameForAccessorMethod(method); globalSecondaryIndexNames.put(propertyName, method.getAnnotation(DynamoDBIndexHashKey.class) .globalSecondaryIndexNames()); globalIndexHashKeyPropertyNames.add(propertyName); } if (dynamoDBIndexHashKey.globalSecondaryIndexName() != null && dynamoDBIndexHashKey.globalSecondaryIndexName().trim().length() > 0) { String propertyName = getPropertyNameForAccessorMethod(method); globalSecondaryIndexNames.put(propertyName, new String[] { method.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexName() }); globalIndexHashKeyPropertyNames.add(propertyName); } }
public String getOverriddenAttributeName(Method method) { if (method != null) { if (method.getAnnotation(DynamoDBAttribute.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBAttribute.class).attributeName())) { return method.getAnnotation(DynamoDBAttribute.class).attributeName(); } if (method.getAnnotation(DynamoDBHashKey.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBHashKey.class).attributeName())) { return method.getAnnotation(DynamoDBHashKey.class).attributeName(); } if (method.getAnnotation(DynamoDBRangeKey.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBRangeKey.class).attributeName())) { return method.getAnnotation(DynamoDBRangeKey.class).attributeName(); } if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) { return method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName(); } if (method.getAnnotation(DynamoDBIndexHashKey.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) { return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName(); } if (method.getAnnotation(DynamoDBVersionAttribute.class) != null && !StringUtils.isEmpty(method.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) { return method.getAnnotation(DynamoDBVersionAttribute.class).attributeName(); } } return null; }
private void addGlobalSecondaryIndexNames(Method method, DynamoDBIndexHashKey dynamoDBIndexHashKey) { if (dynamoDBIndexHashKey.globalSecondaryIndexNames() != null && dynamoDBIndexHashKey.globalSecondaryIndexNames().length > 0) { String propertyName = getPropertyNameForAccessorMethod(method); globalSecondaryIndexNames.put(propertyName, method.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexNames()); globalIndexHashKeyPropertyNames.add(propertyName); } if (dynamoDBIndexHashKey.globalSecondaryIndexName() != null && dynamoDBIndexHashKey.globalSecondaryIndexName().trim().length() > 0) { String propertyName = getPropertyNameForAccessorMethod(method); globalSecondaryIndexNames.put(propertyName, new String[]{method.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexName()}); globalIndexHashKeyPropertyNames.add(propertyName); } }
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; }
private void addGlobalSecondaryIndexNames(Field field, DynamoDBIndexHashKey dynamoDBIndexHashKey) { if (dynamoDBIndexHashKey.globalSecondaryIndexNames() != null && dynamoDBIndexHashKey.globalSecondaryIndexNames().length > 0) { String propertyName = getPropertyNameForField(field); globalSecondaryIndexNames.put(propertyName, field.getAnnotation(DynamoDBIndexHashKey.class) .globalSecondaryIndexNames()); globalIndexHashKeyPropertyNames.add(propertyName); } if (dynamoDBIndexHashKey.globalSecondaryIndexName() != null && dynamoDBIndexHashKey.globalSecondaryIndexName().trim().length() > 0) { String propertyName = getPropertyNameForField(field); globalSecondaryIndexNames.put(propertyName, new String[] { field.getAnnotation(DynamoDBIndexHashKey.class).globalSecondaryIndexName() }); globalIndexHashKeyPropertyNames.add(propertyName); } }
&& !StringUtils.isEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) { return Optional.of(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName()); && !StringUtils.isEmpty(field.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) { return Optional.of(field.getAnnotation(DynamoDBIndexHashKey.class).attributeName());
final DynamoDBIndexHashKey indexHashKey = actualOf(DynamoDBIndexHashKey.class); if (indexHashKey != null) { if (!indexHashKey.globalSecondaryIndexName().isEmpty()) { if (indexHashKey.globalSecondaryIndexNames().length > 0) { throw new DynamoDBMappingException("@DynamoDBIndexHashKey must not specify both HASH GSI name/names"); gsis.put(HASH, Collections.singletonList(indexHashKey.globalSecondaryIndexName())); } else if (indexHashKey.globalSecondaryIndexNames().length > 0) { gsis.put(HASH, Collections.unmodifiableList(Arrays.asList(indexHashKey.globalSecondaryIndexNames()))); } else { throw new DynamoDBMappingException("@DynamoDBIndexHashKey must specify one of HASH GSI name/names");
&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) { return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName(); && StringUtils.isNotEmpty(field.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) { return field.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
if (indexHashKey != null && !indexHashKey.attributeName().isEmpty()) { return indexHashKey.attributeName();
attributeName = indexHashKey.attributeName(); if ( attributeName != null && attributeName.length() > 0 ) return cacheAttributeName(getter, attributeName);