-->
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: How to override the lazy attribute using query
PostPosted: Mon Nov 29, 2004 11:29 am 
Newbie

Joined: Thu Nov 11, 2004 3:24 pm
Posts: 17
I am new to Hibernate, can anyone help me with this query

SELECT B
FROM FavoriteNotice A, Notice B
WHERE A.comp_id.noticeId = B.noticeId
AND A.comp_id.siteminderId = 'johndoe'

The above select is the query which returns me a notice object.
Now this notice object has 3 Hashsets which get data from other tables.
Now i want to load the data of 1 hashset in this query itself thereby over-riding the lazy attribute

The attributes in the Notice class which i want to load is "noticeTenors". And this NoticeTenor class has in turn two hashsets namely "refTradeTypes" and refcurrencies" which also have to be loaded.


So in short ... i have a Notice class and it has a list of NoticeTenors. And each NoticeTenor has multiple trade types and multiple currencies. I want to load all of these in one query (overriding the lazy attirbute using HSQL).

How do i do this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 2:14 am 
Newbie

Joined: Mon Nov 29, 2004 10:15 am
Posts: 3
Hi Vinod

You can use something called as 'Fetch' join to override the lazy loading of aggregates.

Look at this http://www.hibernate.org/117.html and search for eager fetching.

HTH,
-Nilesh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 2:36 am 
Regular
Regular

Joined: Fri Nov 12, 2004 12:07 am
Posts: 57
Location: Beijing,China
I kindly suppose you using inner join fetch in your hql.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 2:38 am 
Regular
Regular

Joined: Fri Nov 12, 2004 12:07 am
Posts: 57
Location: Beijing,China
I kindly suppose you using inner join fetch in your hql,more help plese refer hibernate reference.


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.