-->
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.  [ 1 post ] 
Author Message
 Post subject: join problem
PostPosted: Wed Mar 26, 2008 5:44 pm 
Beginner
Beginner

Joined: Mon Mar 17, 2008 11:25 am
Posts: 42
hi,
I have fallowing problem with join querry ;im execiuting


Code:
result=session.createQuery("from Products p join p.categories categories where categorieId=1 ").list();


and I recive fallowing error :

Code:
Exception in thread "main" org.hibernate.QueryException: could not resolve property: categories of: model.Products [from model.Products p join p.categories categories where categorieId=1 ]
   at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44)
   at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38)
   at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1358)
   at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:279)
   at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:386)
   at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:566)
   at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:241)
   at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:188)
   at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
   at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:308)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3275)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3067)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
   at manager.ProductsManager.ListCat(ProductsManager.java:65)
   at manager.ProductsManager.main(ProductsManager.java:74)


please help


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

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.