-->
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: Problem using outer join in HQL
PostPosted: Thu Sep 22, 2005 11:03 am 
Newbie

Joined: Thu Sep 22, 2005 10:28 am
Posts: 1
I tried to left outer join Project table and Activity table using HQL. But i got the following error... details as shown below. Plz help me out this incertitued.

Hibernate version:3.0.5

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

Code:
      String qry ="";
      qry = "from net.test.ProjectPOJO left outer join net.test.TS_ActivityPOJO";
      Query query = HibernateUtil.getSession().createQuery(qry);
      System.out.println("Size::::"+query.list().size());
      HibernateUtil.closeHibernateSession();


Full stack trace of any exception that occurs:

Code:
java.lang.NullPointerException
   at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:264)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3022)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2841)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
   at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
   at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
   at net.assyst.peopleplus.dao.TestJoin.main(TestJoin.java:21)
Exception in thread "main"


Name and version of the database you are using: Sybase Adaptive Server Enterprise 11.9.2.3

The generated SQL (show_sql=true): none


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 11:42 am 
Newbie

Joined: Wed Apr 13, 2005 11:25 am
Posts: 7
the query u wrote is wrong . something like :
" from net.test.ProjectPOJO project left outer join project.activity TS_activity "

assuming that project has a field member named activity of type net.test.TS_ActivityPOJO


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.