hibernate/hibernate-orm · error · UnknownTableReferenceException

Unable to determine TableReference (`%s`) for `%s`

Error message

Unable to determine TableReference (`%s`) for `%s`

What it means

Error "Unable to determine TableReference (`%s`) for `%s`" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/ColumnReferenceQualifier.java:42

	 *
	 * @param navigablePath The path for which to look up the table reference, may be null
	 * @param tableExpression The table expression for which to look up the table reference
	 *
	 * @throws UnknownTableReferenceException to indicate that the given tableExpression could not be resolved
	 */
	default TableReference resolveTableReference(
			NavigablePath navigablePath,
			String tableExpression) {
		assert tableExpression != null;

		final TableReference tableReference = getTableReference(
				navigablePath,
				tableExpression,
				true
		);

		if ( tableReference == null ) {
			throw new UnknownTableReferenceException(
					tableExpression,
					String.format(
							Locale.ROOT,
							"Unable to determine TableReference (`%s`) for `%s`",
							tableExpression,
							navigablePath
					)
			);
		}

		return tableReference;
	}

	default TableReference resolveTableReference(
			NavigablePath navigablePath,
			ValuedModelPart modelPart,
			String tableExpression) {
		assert modelPart != null;

View on GitHub (pinned to fad1729dce)

Solutions

  1. The column reference qualifier does not match any known table reference in the query's from-clause. Check that the alias/qualification used in the query actually exists.
  2. If the qualifier is generated internally, report it as a Hibernate bug with the query and stack trace.

When it happens

Trigger: A column reference qualifier cannot be resolved to any known table reference.

Common situations: Referencing a column qualified by an alias/table name that is not part of the query's FROM clause, e.g. a typo'd alias or a join omitted from the query.


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