hi all,
is fetch hql option supported by release 2.0
i've got
Code:
net.sf.hibernate.QueryException: in expected: produit.marque [from com.bo.produit.Produit as produit left join fetch produit.marque where produit.fiche.pere.idNomenclature=530]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:92)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:119)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:376)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:354)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1355)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1319)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
when trying to activate it
Code:
from com.bo.produit.Produit as produit left join fetch produit.marque
here is the mapping file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.bo.produit.Produit" table="PRODUIT">
<id column="ID_PRODUIT" name="idProduit" >
<generator class="sequence">
<param name="sequence">SEQ_PRODUIT</param>
</generator>
</id>
<property column="RIN" name="rin" not-null="true" />
<property column="LIBELLE" name="libelleProduit" not-null="true" />
<property column="LIBELLE_RPC" name="libelleRPC" not-null="false" />
<property column="PLUS_PRODUIT" name="plusProduit" not-null="true" />
<property column="DATE_CREATION" name="dateCreation" not-null="true" />
<property column="DATE_MODIFICATION" name="dateModification" not-null="true" />
<property column="ID_FAMILLE_RPC" name="idFamille" not-null="false" />
<property column="MISE_A_DISPOSITION" name="miseADisposition" not-null="false" />
<many-to-one column="ID_NOMENCLATURE" name="fiche" class="com.bo.segmentation.Nomenclature" not-null="false" />
<many-to-one name="marque" column="ID_MARQUE" />
<bag name="valeurs" lazy="true" inverse="true" cascade="all" table="VALEUR_CARACTERISTIQUE">
<key column="ID_PRODUIT"/>
<one-to-many column="ID_PRODUIT" class="com.bo.segmentation.ValeurCaracteristique"/>
</bag>
</class>
</hibernate-mapping>