-->
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.  [ 2 posts ] 
Author Message
 Post subject: org.hibernate.QueryException: could not resolve property:
PostPosted: Tue Jun 19, 2007 1:00 pm 
Newbie

Joined: Mon May 21, 2007 10:41 am
Posts: 2
Location: USA
I have this mapping:
Code:
<class name="classA" table="tableA" lazy="false" schema="A">
    <composite-id name="compositeKey"
   class="classA$PK">
      <key-property name="prop1"   column="col1" type="string"/>
      <key-property name="prop2"  column="col2" type="string"/>
    </composite-id>
    <property name="prop3" column="col3" type="boolean" not-null="true"/>
  </class>


i created a detached criteria for this class like :


Code:
     DetachedCriteria crit = DetachedCriteria.forClass(classA);
    String name = "test";
            crit.add(Restrictions.eq("prop1",name));

List list = getHibernateTemplate().findByCriteria(crit);

giving the error: org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property:

BUTTTTTTT IF I Do:
    String name = "test";
            crit.add(Restrictions.eq("prop3",new Boolean(true));
returns the proper  list of values



I think for the first query the type is not getting resolved correctly,but everything seams fine but could not resolve this issue.every help is highly appriated.


--raju


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 6:52 pm 
Regular
Regular

Joined: Wed May 05, 2004 8:01 am
Posts: 53
Have you tried crit.add(Restrictions.eq("compositeKey.prop1",name)); ?

Please rate if that helped.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.