-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: CreateFilter problem...
PostPosted: Fri Dec 16, 2005 7:19 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
Hibernate version: 3.1

Mapping documents:
Code:
<hibernate-mapping default-lazy="false">

    <class name="com.coginfo.kf.bean.Categoria" table="KFT_CATEGORIA" select-before-update="true">
        <id name="codint" type="long" unsaved-value="0">
            <generator class="sequence">
               <param name="sequence">KF_SEQ_CATEGORIA</param>
            </generator>   
         </id>

        <property name="cafdsc" type="string">
            <column name="cafdsc" length="1000" sql-type="string" not-null="true"/>
        </property>


      <set name="categoriaRuoli"  lazy="true" cascade="none">
         <key column="codintctg"/>
         <one-to-many class="com.coginfo.kf.bean.CategoriaRuolo"/>
      </set>
    </class>

</hibernate-mapping>

<hibernate-mapping default-lazy="false">

    <class name="com.coginfo.kf.bean.CategoriaRuolo" table="KFT_CATEGORIA_RUOLO" select-before-update="true">
       <composite-id name="id" class="com.coginfo.kf.bean.CategoriaRuoloPk">
         <key-many-to-one name="codintctg"  column="codintctg" class="com.coginfo.kf.bean.Categoria"/>
         <key-many-to-one name="codintrul"  column="codintrul" class="com.coginfo.kf.bean.Ruolo"/>
       </composite-id>
    </class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

categorieDisponibili = service.getSession().createFilter(report.getCategorie(),"where this.categoriaRuoli.id.codintrul in (" + idlistaRuoli + ")").list();

Full stack trace of any exception that occurs:
org.hibernate.QueryException: could not resolve property: codintrul of: com.coginfo.kf.bean.CategoriaRuolo [where this.categoriaRuoli.id.codintrul in (141)]

Name and version of the database you are using: Oracle 9


Could anyone help me?? It's very important! thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 16, 2005 9:09 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
about previous post, in hibernate conf :
<property name="hibernate.query.factory_class">ASTQueryTranslatorFactory</property>


now with this:
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

org.hibernate.QueryException: illegal syntax near collection: id [where this.categoriaRuoli.id.codintrul in (141)

so, i don't understand whitch hibernate.query.factory_class must use...

thanks[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 16, 2005 11:11 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
anyone help me???

thanks again


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.