Announcement Announcement Module
Collapse
No announcement yet.
lazy loading? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment

    Working...
    X