[ 
https://issues.apache.org/jira/browse/CAY-1802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13828543#comment-13828543
 ] 

Oleg Artyukevich commented on CAY-1802:
---------------------------------------

Already fixed in version 3.2 .

> Records present in multiple prefetch paths are not merged correctly into 
> final result
> -------------------------------------------------------------------------------------
>
>                 Key: CAY-1802
>                 URL: https://issues.apache.org/jira/browse/CAY-1802
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1B2
>            Reporter: Dzmitry Kazimirchyk
>         Attachments: CAY-1802-test.patch
>
>
> If same records getting prefetched through multiple prefetch paths, the final 
> result will content corrupted records with relationships set to null. Example:
> Paintings are present in one prefetch path:
>         SelectQuery q = new SelectQuery(Artist.class);
>         q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);
>         q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY + "." + 
> Painting.TO_PAINTING_INFO_PROPERTY);
> artist.getPaintingArray().get(0).getPaintingInfo() will contain correct non 
> null PaintingInfo record.
> But if paintings are present in multiple prefetch paths:
>         SelectQuery q = new SelectQuery(Artist.class);
>         q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);
>         q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY + "." + 
> Painting.TO_PAINTING_INFO_PROPERTY);
>         q.addPrefetch(Artist.ARTIST_EXHIBIT_ARRAY_PROPERTY);
>         q.addPrefetch(Artist.ARTIST_EXHIBIT_ARRAY_PROPERTY + "." + 
> ArtistExhibit.TO_EXHIBIT_PROPERTY);
>         q.addPrefetch(Artist.ARTIST_EXHIBIT_ARRAY_PROPERTY + "." + 
> ArtistExhibit.TO_EXHIBIT_PROPERTY + "." + Exhibit.TO_GALLERY_PROPERTY);
>         q.addPrefetch(Artist.ARTIST_EXHIBIT_ARRAY_PROPERTY + "." + 
> ArtistExhibit.TO_EXHIBIT_PROPERTY + "." + Exhibit.TO_GALLERY_PROPERTY + "." + 
> Gallery.PAINTING_ARRAY_PROPERTY);
> artist.getPaintingArray().get(0).getPaintingInfo() will return null even if 
> there is PaintingInfo associated with painting.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to