-->
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.  [ 7 posts ] 
Author Message
 Post subject: Query problem
PostPosted: Fri Nov 07, 2003 10:31 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
I have following query:
Code:
select infobit.name from infobit in class com.infodesire.infobit.dao.InfobitImpl where infobit.actualVersion.content.attributes['language']='DE'


Where InfobitImpl has many-to-one to actual version:
Code:
      <many-to-one
            name="actualVersion"
            class="com.infodesire.infobit.dao.VersionImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="actualversionid"
            not-null="false"
        />


VersionImpl is one-to-one to content, which got map of attributes
( primitive, string )
Resulting Query ( SQL, mysql) is:
Code:
select infobit.name as x0_0_ from infobit infobit, content_attributes attribut2_ where (attribut2_.value='DE'  and infobit.actualversionid=versioni0_.id and versioni0_.id=contenti1_.id and contenti1_.id=attribut2_.contentid and attribut2_.name = 'language')


It looks to me, that hibernate correctly travesed relation to content,
but somehow forgot to join in version...

Or do I misss something important?

tia


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 11:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
(1) What version of Hibernate is it?
(2) If it is a current version, please submit a test case to JIRA
(3) You should be able to work around this prob by writing:


Code:
select infobit.name from InfobitImpl infobit
join infobit.actualVersion version
where version.content.attributes['language']='DE'


or something (i'm not certain exactly what "content" is).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 11:18 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
(1) What version of Hibernate is it?
2.0.3 originally as well as current CVS version
( updated 1 hour ago to check if the problem is there )

(2) If it is a current version, please submit a test case to JIRA
On the way, after I looked into problem. Maybe I'll find solution...

(3) You should be able to work around this prob by writing:
...
kind of uncool in my situation... I have precooked from clause,
and users submit only where part to dao...

regards,[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 11:22 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
gavin wrote:

or something (i'm not certain exactly what "content" is).


Just forgot...

content is one-one with version


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 6:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
FYI, I have just fixed this in CVS.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 8:44 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
It seems that anoymous CVS is still not up to date...

Which files did you patched?

tia,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 10:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Check the CVS commits mail list


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.