Example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapperConfig DEFAULT

List of usage examples for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapperConfig DEFAULT

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapperConfig DEFAULT.

Prototype

DynamoDBMapperConfig DEFAULT

To view the source code for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapperConfig DEFAULT.

Click Source Link

Document

Default configuration; these defaults are also applied by the mapper when only partial configurations are specified.

Usage

From source file:org.socialsignin.spring.data.dynamodb.query.QueryRequestMapper.java

License:Apache License

public QueryRequestMapper(AmazonDynamoDB amazonDynamoDB, DynamoDBMapperConfig config,
        DynamoDBMapper dynamoDBMapper) {
    this.amazonDynamoDB = amazonDynamoDB;
    this.dynamoDBMapper = dynamoDBMapper;
    this.config = config == null ? DynamoDBMapperConfig.DEFAULT : config;
}

From source file:org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperConfigFactory.java

License:Apache License

@Override
public DynamoDBMapperConfig getObject() throws Exception {
    return DynamoDBMapperConfig.DEFAULT;
}

From source file:org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperConfigFactory.java

License:Apache License

@Nullable
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof DynamoDBMapperConfig) {
        DynamoDBMapperConfig dynamoDBMapperConfig = (DynamoDBMapperConfig) bean;
        if (dynamoDBMapperConfig == DynamoDBMapperConfig.DEFAULT) {
            return bean;
        }//from ww  w . j  a  va 2s.c om
        // #146, #81 #157
        // Trying to fix half-initialized DynamoDBMapperConfigs here.
        // The old documentation advised to start with an empty builder. Therefore we
        // try here to set required fields to their defaults -
        // As the documentation at
        // https://github.com/derjust/spring-data-dynamodb/wiki/Alter-table-name-during-runtime
        // (same as https://git.io/DynamoDBMapperConfig)
        // now does: Start with #DEFAULT and add what's required
        DynamoDBMapperConfig.Builder emptyBuilder = DynamoDBMapperConfig.builder(); // empty (!) builder

        if (dynamoDBMapperConfig.getConversionSchema() == null) {
            LOGGER.warn(
                    "No ConversionSchema set in the provided dynamoDBMapperConfig! Merging with DynamoDBMapperConfig.DEFAULT - Please see https://git.io/DynamoDBMapperConfig");
            // DynamoDBMapperConfig#DEFAULT comes with a ConversionSchema
            emptyBuilder.withConversionSchema(DynamoDBMapperConfig.DEFAULT.getConversionSchema());
        }

        if (dynamoDBMapperConfig.getTypeConverterFactory() == null) {
            LOGGER.warn(
                    "No TypeConverterFactory set in the provided dynamoDBMapperConfig! Merging with DynamoDBMapperConfig.DEFAULT - Please see https://git.io/DynamoDBMapperConfig");
            // DynamoDBMapperConfig#DEFAULT comes with a TypeConverterFactory
            emptyBuilder.withTypeConverterFactory(DynamoDBMapperConfig.DEFAULT.getTypeConverterFactory());
        }

        return createDynamoDBMapperConfig(dynamoDBMapperConfig, emptyBuilder);

    } else {
        return bean;
    }
}