Can't compare test expression of type [CommodityEntity] with element of type [BasicSqmPathSource(materialId : Integer)]

This is a duplicate of your other post Regarding Subquery in JPQL,please help me on this.