Hello all,
Here's my question :
I have this mapping :
Code:
<hibernate-mapping>
<class name="StatistiquePersistent" table="STATISTIQUE">
<id name="numStatistique" column="PK_STATISTIQUE">
<generator class="sequence">
<param name="sequence">S_STATISTIQUE_ENR</param>
</generator>
</id>
<property name="entiteId" column="ENTITE_ID" not-null="true"/>
<many-to-one name="typeStat" column="FK_TYPE_STATISTIQUE" not-null="true" class="TypeStatistiquePersistent"/>
<set name="statEnregistrements" lazy="true" inverse="true" cascade="save-update">
<key column="FK_STATISTIQUE"/>
<one-to-many class="StatistiqueEnregistrementPersistent"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="StatistiqueEnregistrementPersistent" table="STATISTIQUE_ENREGISTREMENT">
<id name="numStatistiqueEnregistrement" column="PK_STATISTIQUE_ENR">
<generator class="sequence">
<param name="sequence">S_STATISTIQUE_ENR</param>
</generator>
</id>
<property name="cumul" column="CUMUL" not-null="true"/>
<many-to-one name="etat" column="FK_ETAT" class="EtatPersistent"/>
<property name="ordreAffichage" column="ORDRE_AFFICHAGE" not-null="true"/>
<many-to-one name="statistique" column="FK_STATISTIQUE" class="StatistiquePersistent"/>
</class>
</hibernate-mapping>
I need to load my "Statistiques" and its set of "StatistiquesEnregistrement" ordered by their "ordreAffichage" property.
My query was :
Code:
queryString = "select listeStat from StatistiquePersistent as listeStat " +
"and listeStat.typeStat.libelleTypeStatistique <> :typeStatJournalier " +
"group by listeStat.typeStat.numTypeStatistique " +
"order by listeStat.typeStat.numTypeStatistique asc, " +
"listeStat.statEnregistrements.ordreAffichage asc" ;
And then I had this exception :
Code:
expecting 'elements' or 'indices' after: ordreAffichage
I don't see how to use "elements" with an "order by" clause.
Have someone an hint for me ?
Thanx in advance.