-->
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: The translation of hql from hibernate to postgres is wrong
PostPosted: Tue Feb 26, 2008 5:47 am 
Newbie

Joined: Mon Feb 25, 2008 1:14 pm
Posts: 8
I am working with postgresql version 8.0.13
and when i write the hibernate code

Code:
select sig.insertionsStrings
from generated.generatedFiles.SignaledEvents sig
where sig.insertionsStrings in
   (select signa.insertionsStrings
    from generated.generatedFiles.SignaledEvents signa
    inner join signa.insertionsStrings ins
    where ins.id.index=1 and ins.insertionStr='hhhhh')
and
sig.insertionsStrings in
   (select signa.insertionsStrings
    from generated.generatedFiles.SignaledEvents signa
    inner join signa.insertionsStrings ins
    where ins.id.index=2 and ins.insertionStr='gggg')


it answer me that there is sql grammer exception.

the sql code is
Code:
  insertions1_.id as id28_,
  insertions1_.index as index28_,
  insertions1_.insertion_str as insertion3_28_
from
  public.signaled_events signaledev0_
inner join
  public.insertions_string insertions1_
   on signaledev0_.id=insertions1_.id,
  public.insertions_string insertions2_,
  public.insertions_string insertions6_
where
  signaledev0_.id=insertions2_.id
  and signaledev0_.id=insertions6_.id
  and (
   . in (
    select
     .
    from
     public.signaled_events signaledev3_
    inner join
     public.insertions_string insertions4_
      on signaledev3_.id=insertions4_.id,
     public.insertions_string insertions5_
    where
     signaledev3_.id=insertions5_.id
     and insertions4_.index=1
     and insertions4_.insertion_str='hhhhh'
   )
  )
  and (
   . in (
    select
     .
    from
     public.signaled_events signaledev7_
    inner join
     public.insertions_string insertions8_
      on signaledev7_.id=insertions8_.id,
     public.insertions_string insertions9_
    where
     signaledev7_.id=insertions9_.id
     and insertions8_.index=2
     and insertions8_.insertion_str='gggg'
   )
  )


and the problem is the "." before the 'in' and the "." after the select - the postgres does not recognized them
how do I solve it?

thanks in advance
[/code]


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.