Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

left outer join *= how make compitible in HQL

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi in my query I am using an codition say p.msgseqid *= s.msgseqid for left outer join but this is not compitible in hql .. I want to make this works in hql without using that left outer join and on statement.... because of that i have to made changes in the hole sql query please help me out..
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My full sql query

 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you have the Hibernate's chapter about HQL and joins. I think it can help you: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry dear but not found any help there..
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kaustubh G Sharma wrote:sorry dear but not found any help there..


You said in your first post:

Hi in my query I am using an codition say p.msgseqid *= s.msgseqid for left outer join but this is not compitible in hql


Yes, that notation may be isn't compatible with HQL, but in the chapter I told you there are examples about how to do left joins in HQL.
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know dear that how can we do left join in hql but if I use those 'left outer join' and 'on' statement then I have to made changes to all the places in my query... I just need to replace this *= to HQL compitable.

Thanks
Kaustubh
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tries many option to enable left outer join in HQL but it didn't worked for me please help me out to solve this issues..

1. ON keyword is not accepted by it
2. *= gives error
3 not able to find correct syntax for it
4 getting error "Path expected for join"
5 sometimes nullpointer exception

my query is
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, I point you to the same reference chapter: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html

Within section 14.3 Associations and joins, you have some examples of left join with HQL. As you don't want to read, I'll opy some of the
examples which are in the reference:

from Cat as cat
join cat.mate as mate
left join cat.kittens as kitten


May be this can help you, but you should read something....
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well I follow every instruction written over there but finally i come up with "hibernatequeryexception path expected for join" error
do i have to make any relation regarding this tables in there hbm.xml files for the outer join . Mean to say that do i have to made entries like many to one or one to many types in their hbm.xml ??
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My hbm.xml codes...

first one is for prioritymanagement table




 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2nd one is MessageExchanged table

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me out.. if you need more info please let me know...
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please reply if you know something about this problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic