diff --git a/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationParser.java b/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationParser.java index e8b489a23..a7ca30444 100644 --- a/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationParser.java +++ b/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationParser.java @@ -68,7 +68,7 @@ public abstract class AnnotationParser extends AnnotationBase { } else { prop.setId(); if (prop.getPropertyType().equals(UUID.class)) { - if (descriptor.getIdGeneratorName() == null) { + if (readConfig.isIdGeneratorAutomatic() && descriptor.getIdGeneratorName() == null) { descriptor.setUuidGenerator(); } } diff --git a/src/main/java/io/ebeaninternal/server/deploy/parse/ReadAnnotationConfig.java b/src/main/java/io/ebeaninternal/server/deploy/parse/ReadAnnotationConfig.java index 4b3bf96d0..545bcab0c 100644 --- a/src/main/java/io/ebeaninternal/server/deploy/parse/ReadAnnotationConfig.java +++ b/src/main/java/io/ebeaninternal/server/deploy/parse/ReadAnnotationConfig.java @@ -15,6 +15,7 @@ class ReadAnnotationConfig { private final boolean eagerFetchLobs; private final boolean javaxValidationAnnotations; private final boolean jacksonAnnotations; + private final boolean idGeneratorAutomatic; ReadAnnotationConfig(GeneratedPropertyFactory generatedPropFactory, String asOfViewSuffix, String versionsBetweenSuffix, ServerConfig serverConfig) { @@ -23,6 +24,7 @@ class ReadAnnotationConfig { this.versionsBetweenSuffix = versionsBetweenSuffix; this.disableL2Cache = serverConfig.isDisableL2Cache(); this.eagerFetchLobs = serverConfig.isEagerFetchLobs(); + this.idGeneratorAutomatic = serverConfig.isIdGeneratorAutomatic(); this.javaxValidationAnnotations = generatedPropFactory.getClassLoadConfig().isJavaxValidationAnnotationsPresent(); this.jacksonAnnotations = generatedPropFactory.getClassLoadConfig().isJacksonAnnotationsPresent(); @@ -48,6 +50,10 @@ class ReadAnnotationConfig { return eagerFetchLobs; } + public boolean isIdGeneratorAutomatic() { + return idGeneratorAutomatic; + } + boolean isJavaxValidationAnnotations() { return javaxValidationAnnotations; }