#2915 - Fix 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 committed 2023-01-20 08:27:09 +13:00
1 parent 03c9782d63
commit 2a6c60c89b
1 file changed
+2 -3
@@ -465,10 +465,9 @@ final class AnnotationFields extends AnnotationParser {
if (!gen.generator().isEmpty()) { if (!gen.generator().isEmpty()) {
// use a custom IdGenerator // use a custom IdGenerator
PlatformIdGenerator idGenerator = generatedPropFactory.getIdGenerator(gen.generator()); PlatformIdGenerator idGenerator = generatedPropFactory.getIdGenerator(gen.generator());
if (idGenerator == null) { if (idGenerator != null) {
throw new IllegalStateException("No custom IdGenerator registered with name " + gen.generator()); descriptor.setCustomIdGenerator(idGenerator);
} }
descriptor.setCustomIdGenerator(idGenerator);
} else if (prop.getPropertyType().equals(UUID.class)) { } else if (prop.getPropertyType().equals(UUID.class)) {
descriptor.setUuidGenerator(); descriptor.setUuidGenerator();
} }