• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CGLIB Proxy even when calling query to load object

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone seen an issue where they are running a query which will load a Collection, but because one of the Objects that would be in the result set was already lazy loaded before, that the collection has all real objects and one Proxy.

For instance we have an Event object which has a Main Photo and a Collection of Photos.

When we retrieved the Event object the MainPhoto object was assigned with a Proxy object, the Collection of Photos wasn't loaded at all.

Then we called a Repository that would get all the Photos for an event and assign the returned List to the event.setPhotos(List<Photo> photos). In the List of photos is all the photos as fully initialized domain objects with real data and the mainphoto still as a proxy.

And no it isn't calling photos.add(mainPhoto), the main photo is a photo that is in the list and returned by the query to get all the photos of the event.

Thanks

Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic