Matt,

Just wanted to double check the following:

1.  All my mappings are bidirectional.  (i.e.: for every OneToMany there is
a ManyToOne)
2.  In this particular scenario I'm not using a HQL query, but I'm
navigating the object graph returned by GenericDao<WebPage,Long>.get().  I'm
assuming that by using Lazy Fetching, Hibernate gives me the 
mapped collections only when I request it via its Getter/Setters.  (Am I
correct ?)

Here is the code that raises the exception:

********** WebPage.java *****************

/**
*  Returns the maintenance page ("under contruction") 
* if the requested page is under maintenance.
*
**/
public Page getMaintenancePage(WebPage webPage) throws
InvalidWebPageStateException, PageNotFoundException
{
        if(!webPage.isInMaintenance())
        {
                return InvalidWebPageStateException("webpage must be in 
maintenance");
        }       
        
        return 
webPage.getCategory().getPage().getTemplate().getMaintenancePage();  
}


********** Template.java *****************

/**
*  Returns the MaintenacePage submitted under the current template 
* (i.e. the webdesigner must have uploaded a Maintenance Page as part
* of the template.)
*
**/
public Page getMaintenancePage() throws PageNotFoundException
{
        for(Page page: this.pages)
        {
                if(page.getPageType().equals(PageType.MAINTENANCE))
                {
                        return page;
                }
        }
        throw new PageNotFoundException("A Maintenance page was not found");
}


-- 
View this message in context: 
http://www.nabble.com/LazyInitializationException%3A-illegal-access-to-loading-collection....-tf4152650s2369.html#a11815396
Sent from the AppFuse - User mailing list archive at Nabble.com.

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

Reply via email to