hibernate/hibernate-orm · error · MappingException

Unable to determine implicit sequence name for target table

Error message

Unable to determine implicit sequence name for target table '

What it means

Error "Unable to determine implicit sequence name for target table '" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/id/enhanced/StandardNamingStrategy.java:101

		final String base = getString( IMPLICIT_NAME_BASE, configValues, rootTableName );
		if ( isNotEmpty( explicitSuffix ) && isNotEmpty( base ) ) {
			// an "implicit name suffix" was specified
			return isQuoted( base )
					? "`" + unQuote( base ) + explicitSuffix + "`"
					: base + explicitSuffix;
		}
		else {
			final String annotationGeneratorName = getString( GENERATOR_NAME, configValues );
			if ( isNotEmpty( annotationGeneratorName ) ) {
				return annotationGeneratorName;
			}
			else if ( isNotEmpty( base ) ) {
				return isQuoted( base )
						? "`" + unQuote( base ) + DEF_SEQUENCE_SUFFIX + "`"
						: base + DEF_SEQUENCE_SUFFIX;
			}
			else {
				throw new MappingException( "Unable to determine implicit sequence name for target table '" + rootTableName + "'" );
			}
		}
	}

	@Override
	public QualifiedName determineTableName(
			Identifier catalogName,
			Identifier schemaName,
			Map<?, ?> configValues,
			ServiceRegistry serviceRegistry) {
		return qualifiedTableName( catalogName, schemaName, serviceRegistry,
				implicitTableName( configValues ) );
	}

	private static String implicitTableName(Map<?, ?> configValues) {
		final String generatorName = getString( GENERATOR_NAME, configValues );
		return isNotEmpty( generatorName ) ? generatorName : DEF_TABLE;
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Specify the sequence name explicitly in the @SequenceGenerator/@GeneratedValue mapping for that table.

When it happens

Trigger: Thrown when Hibernate cannot derive a sequence name for a table-based id generator.

Common situations: Typical situations: missing sequenceName/table configuration on the generator; per-table generator without naming information.


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