hibernate/hibernate-orm · error · PathException

Not a property path '{path}'

Error message

Not a property path '{path}'

What it means

Error "Not a property path '{path}'" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/sql/internal/NativeQueryImpl.java:1511

		}
		else if ( part instanceof EntityAssociationMapping entityAssociationMapping ) {
			entityMappingTypeByTableAlias.put( tableAlias, entityAssociationMapping.asEntityMappingType() );
		}
		else if ( part instanceof EmbeddedAttributeMapping ) {
			throw new UnsupportedOperationException();
		}
	}

	@Override
	public NativeQueryImplementor<R> addJoin(String tableAlias, String path) {
		createFetchJoin( tableAlias, path );
		return this;
	}

	private FetchReturn createFetchJoin(String tableAlias, String path) {
		final int loc = path.indexOf( '.' );
		if ( loc < 0 ) {
			throw new PathException( "Not a property path '" + path + "'" );
		}
		final String ownerTableAlias = path.substring( 0, loc );
		final String joinedPropertyName = path.substring( loc + 1 );
		return addFetch( tableAlias, ownerTableAlias, joinedPropertyName );
	}

	@Override
	public NativeQueryImplementor<R> addJoin(String tableAlias, String ownerTableAlias, String joinPropertyName) {
		addFetch( tableAlias, ownerTableAlias, joinPropertyName );
		return this;
	}

	@Override
	public NativeQueryImplementor<R> addJoin(String tableAlias, String path, LockMode lockMode) {
		createFetchJoin( tableAlias, path ).setLockMode( lockMode );
		return this;
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. The given path does not resolve to a persistent property.
  2. Verify the path string matches a mapped attribute of the entity/result class.

When it happens

Trigger: A query object is used through an interface or role it does not implement.

Common situations: Casting or unwrapping a native/HQL, select/mutation query to the wrong type, or passing a non-property path where one is required.


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