Hi,

Carfield Yim wrote:
> I get no reply for a while, is that I ask a wrong question? Anything
> needed to clarify?
> 

too many questions, too few people to answer them...
I generally first answer tricky questions, question that are answered in 
the documentation already take a little longer...

> 
> 
> ---------- Forwarded message ----------
> Date: Tue, 27 Aug 2002 18:44:10 +0800 (GST)
> From: Carfield Yim <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: When will OJB load the foreign key data for 1:n relation?
> 
> As per JDO spec. I can get the 1:n relation data through some Hashset
> method call. e.g.: for every row in table [order] will related to many
> rows in table [order_item]. And when I query an record of [order], I can
> get all related [order_item] through some method like
> getOrderItemByOrderItemId(). 
> 
> 
> I would like to ask, when will these [order_item] query? Is it query
> when I get the [order] item, or Is it query when I call to method? 


depends on your declarations in repository.xml (or.jdo)!
If you set proxy="false" for the collection-descriptor for the 
order_item collection the query is executed immediately once the order 
item is loaded.

If you set proxy="true" it is executed when you call 
order.getOrderItems() for the first time. That's what lazy loading is 
all about. Please read tutorial3.html for details.

cheers,
Thomas

> 
>               \\\|///
>               \- - -//
>              (  @ @  )
> -----------oOOo-(_)-oOOo------------------------------------------------
> Visit my homepage at http://www.carfield.com.hk
> 
> Programming discussion groups
> Software design: news://news.carfield.com.hk/programming.design
> Design Pattern: news://news.carfield.com.hk/programming.design.pattern
> java: news://news.carfield.com.hk/programming.java
> linux: news://news.carfield.com.hk/programming.linux
> ------------------------------------------------------------------------
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to