-->
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: criteria "could not resolve property"
PostPosted: Fri Mar 04, 2005 8:14 pm 
Beginner
Beginner

Joined: Fri Apr 16, 2004 10:25 am
Posts: 44
Location: Brazil
How do I associated tables in criteria?

Criteria crit = HibernateUtil.getSession().createCriteria(conteudoVO.class).
add(Expression.eq("arvoreVO.estruturaArvoreVO.vchtipo",strTipo));

Code:
javax.servlet.ServletException: net.sf.hibernate.QueryException: could not resolve property: arvoreVO.estruturaArvoreVO.vchtipo of: com.bzo2.lupo.vo.conteudoVO
   org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   com.bzo2.lupo.servlets.ValidSessionFilter.doFilter(ValidSessionFilter.java:57)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 05, 2005 3:30 pm 
Newbie

Joined: Sat Mar 05, 2005 2:36 pm
Posts: 19
Hi marceltoma

If you have this code:
Code:
Criteria crit = HibernateUtil.getSession().createCriteria(conteudoVO.class).
add(Expression.eq("arvoreVO.estruturaArvoreVO.vchtipo",strTipo));


Hibernate will try to find the attribute arvoreVO.estruturaArvoreVO.vchtipo within the class conteudoVO. It seems like hibernate could not resolve this property. There could just be a minor misspelling. The first parameter to the eq method should be an attribute of the class supplied to criteria.

As I do not know, what 'conteudo' is, am not sure whether 'arvore' (=tree?) could be an attribute. I will give an example in english:

Code:
HibernateUtil.getSession().createCriteria(Tree.class).
add(Expression.eq("leafColor","green"));


This will limit the criteria to the value green for the attribute leafColor of the class Tree.

Hope this could help,
Kariem


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.