org.hibernate.hql.ast.QuerySyntaxException: table not mapped when table is defined as set

Hi everyone. I am working in a old project.

I know this question has been asked by many users but I think there is something different in this case.

I have the hibernate mapping file where I define this entity:

<class name="ActividadGrupoBolsa" table="ACTIVIDAD_GRUPO_BOLSA">
    <id name="id" type="long">
        <generator class="increment" />
    </id>
    <property name="uid" type="string" not-null="true" unique="true" />
    <property name="cantidad" type="integer" not-null="true" />
    <many-to-one lazy="false" name="actividadModulo" class="ActividadModulo"
        not-null="true" />
        
    <set  name="actividadGrupoBolsaTipoPieza" table="ACTIVIDAD_GRUPO_BOLSA_TIPO_PIEZA" lazy="false" cascade="save-update">
        <key column="actividad_grupo_bolsa" />
        <composite-element class="ActividadGrupoBolsaTipoPieza" >
            <property name="numPiezas" type="integer" not-null="true" />
            <many-to-one name="tipoPieza" lazy="false" class="TipoPieza" not-null="true" />
        </composite-element>
    </set>
</class>

I am trying to execute the next hql query where the following reference appears:

 StringBuffer hql = new StringBuffer();
            hql.append(" SELECT b.nombre, ").append(" COUNT(distinct b.uid),  ")
                    .append(" SUM(a2.numPiezas * a.cantidad * c.valor)")
                    .append(" FROM ActividadGrupoBolsa a, actividadGrupoBolsaTipoPieza a2 ")
                    .append(", ActividadModulo b ").append(", TipoPieza c ");

The errors is:

org.hibernate.hql.ast.QuerySyntaxException: actividadGrupoBolsaTipoPieza is not mapped

I do not understand why the error occurs if I am indicating the name of the table as it appears in the xml file.

Please could someone help me?

Thanks