Merge pull request #2935 from ebean-orm/feature/2915-invalid-id-mapping

#2915 - Failing test for - generator param of @GeneratedValue is not ignored when using GenerationType.AUTO on db where this uses identity
This commit is contained in:
Rob Bygrave authored and GitHub committed 2023-01-20 08:34:25 +13:00
commit d7e6feebc2
3 files changed
+56 -3

No files matched your search

@@ -465,10 +465,9 @@ final class AnnotationFields extends AnnotationParser {
if (!gen.generator().isEmpty()) {
// use a custom IdGenerator
PlatformIdGenerator idGenerator = generatedPropFactory.getIdGenerator(gen.generator());
if (idGenerator == null) {
throw new IllegalStateException("No custom IdGenerator registered with name " + gen.generator());
if (idGenerator != null) {
descriptor.setCustomIdGenerator(idGenerator);
}
descriptor.setCustomIdGenerator(idGenerator);
} else if (prop.getPropertyType().equals(UUID.class)) {
descriptor.setUuidGenerator();
}