/** * {@inheritDoc} */ @Override public final DynamoDBAutoGenerateStrategy getGenerateStrategy() { if (properties.autoGenerator() != null) { return properties.autoGenerator().getGenerateStrategy(); } return null; }
/** * Creates a new auto-generator from the {@link DynamoDBAutoGenerated} * annotation if present. */ public DynamoDBAutoGenerator<T> autoGenerator() { Annotation annotation = super.map.get(DynamoDBAutoGenerated.class); if (annotation != null) { final DynamoDBAutoGenerated generated = actualOf(DynamoDBAutoGenerated.class); annotation = (generated == annotation ? null : annotation); DynamoDBAutoGenerator<T> generator = overrideOf(generated.generator(), targetType, annotation); if (generator.getGenerateStrategy() == CREATE && targetType.isPrimitive()) { throw new DynamoDBMappingException( "type [" + targetType + "] is not supported for auto-generation" + "; primitives are not allowed when auto-generate strategy is CREATE" ); } return generator; } return null; }
/** * {@inheritDoc} */ @Override public final DynamoDBAutoGenerateStrategy getGenerateStrategy() { if (properties.autoGenerator() != null) { return properties.autoGenerator().getGenerateStrategy(); } return null; }
/** * Creates a new auto-generator from the {@link DynamoDBAutoGenerated} * annotation if present. */ public DynamoDBAutoGenerator<T> autoGenerator() { Annotation annotation = super.map.get(DynamoDBAutoGenerated.class); if (annotation != null) { final DynamoDBAutoGenerated generated = actualOf(DynamoDBAutoGenerated.class); annotation = (generated == annotation ? null : annotation); DynamoDBAutoGenerator<T> generator = overrideOf(generated.generator(), targetType, annotation); if (generator.getGenerateStrategy() == CREATE && targetType.isPrimitive()) { throw new DynamoDBMappingException( "type [" + targetType + "] is not supported for auto-generation" + "; primitives are not allowed when auto-generate strategy is CREATE" ); } return generator; } return null; }