Results 1 to 2 of 2

Thread: lazy loading?

  1. #1
    Join Date
    Jul 2009
    Posts
    20

    Default lazy loading?

    Hi, I have the following scenario:

    • 1 zone has many countries
    • 1 country has many operators
    • 1 operator has many services


    and I also wrote a service which I use like this:
    PHP Code:
    public Collection<CountrygetCountriesByZone(String zone_id)
            
    throws WsException{

            
    // No empty id allowed
            
    if(zone_id == null || zone_id == "")
                throw new 
    WsException("zone_id cannot be empty");
            
            
    // Get the country
            
    Zone z zoneService.get(zone_id);
            
            
    // Zone does not exist
            
    if(== null)
                throw new 
    WsException("Zone with id " zone_id " does not exsit");
            
            
    // Get the countries out of the zone
            
    Collection<Countryzc z.getCountries();
            
            
    // Return the collection
            
    return zc;

        } 
    and this returns me the collection of countries and for each country I also have operators and services.

    how do I tell hibernate not to search partners (and therefore services)???
    It has something to do with lazyloading, but I'm not sure how to configure it.

    thanks!

  2. #2

    Default

    Hi,
    It is not directly related with Spring.
    Look on following topics in hibernate documentaion:

    http://docs.jboss.org/hibernate/stab...mance-fetching

    http://docs.jboss.org/hibernate/stab...assoc-fetching

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •