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.  [ 4 posts ] 
Author Message
 Post subject: HQL Query using a Map
PostPosted: Tue Dec 14, 2004 4:17 pm 
Newbie

Joined: Tue Dec 14, 2004 4:13 pm
Posts: 2
I am using Hibernate 2.1.

I am wondering how to write an HQL query that takes a HashMap relationship I have set up at the object level into consideration.

For example I have a map defined in my xdoclet as follows:
Code:
   /**
    * @hibernate.map table="ed_landing_page_article" cascade="none" lazy="false"
    * @hibernate.collection-key column="ed_landing_page_id"
    * @hibernate.index-many-to-many column="ed_landing_page_bucket_id" class="com.edmunds.editorial.model.LandingPageBucket"
    * @hibernate.collection-many-to-many column="article_id" class="com.edmunds.editorial.model.Article"
    * @hibernate.collection-cache usage="read-write" */
   public Map getArticleMap() {
      return articleMap;
   }



How can I use the articleMap in my HQL query to do a join to another object that is the actual key within this map. My key is a LandingPageBucket object. How can I join these 2 objects via HQL?

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 4:18 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
index-many-to-many?
check ternary association in reference guide

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 4:45 pm 
Newbie

Joined: Tue Dec 14, 2004 4:13 pm
Posts: 2
Yes this is an index-man-to-many relationship.

I just want to know the syntax basically to use a map in a HQL query?

For instance:

select objectWithMap from
objectWithMap , keyInMapObject
where objectWithMap.map = keyInMapObject

I want to know how to do a join in HQL using a map?

Where is this "ternary assocation" ref guide?

Thanks!


Top
 Profile  
 
 Post subject: Did you get any response to this?
PostPosted: Wed Dec 29, 2004 6:55 pm 
Regular
Regular

Joined: Thu Sep 09, 2004 6:46 pm
Posts: 96
Did you get any response to this?


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