hibernate/hibernate-orm · error · HibernateException

Specified Annotation type (%s) does not have an override for

Error message

Specified Annotation type (%s) does not have an override form

What it means

Error "Specified Annotation type (%s) does not have an override form" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/internal/DialectOverridesAnnotationHelper.java:51

				final var overrideAnnotation =
						dialectOverrideMember.getAnnotation( DialectOverride.OverridesAnnotation.class );
				if ( overrideAnnotation != null ) {
					// The "real" annotation.  e.g. `org.hibernate.annotations.Formula`
					final var baseAnnotation = overrideAnnotation.value();
					// the "override" annotation.  e.g. `org.hibernate.annotations.DialectOverride.Formula`
					//noinspection unchecked
					final var dialectOverrideAnnotation = (Class<? extends Annotation>) dialectOverrideMember;
					results.put( baseAnnotation, dialectOverrideAnnotation );
				}
			}
		}
		return results;
	}

	public static <A extends Annotation, O extends Annotation> Class<O> getOverrideAnnotation(Class<A> annotationType) {
		final Class<O> overrideAnnotation = findOverrideAnnotation( annotationType );
		if ( overrideAnnotation == null ) {
			throw new HibernateException(
					String.format(
							Locale.ROOT,
							"Specified Annotation type (%s) does not have an override form",
							annotationType.getName()
					)
			);
		}
		else {
			return overrideAnnotation;
		}
	}

	public static <A extends Annotation, O extends Annotation> Class<O> findOverrideAnnotation(Class<A> annotationType) {
		//noinspection unchecked
		return (Class<O>) OVERRIDE_MAP.get( annotationType );
	}

	public static <T extends Annotation> T getOverridableAnnotation(

View on GitHub (pinned to fad1729dce)

Solutions

  1. Use an annotation type that has a dialect-override form, or remove the override usage for this annotation.

When it happens

Trigger: A custom @TypeBinderType/@AttributeBinderType annotation cannot be processed by its binder.

Common situations: A binder implementation that does not accept the annotation type it is registered for, or a binder throwing while processing the annotation.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/fc8c45ead02ecce9. Report an issue: GitHub.