You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2013/07/09 13:23:49 UTC

[jira] [Commented] (CAY-1695) Unexpected null value in bidirectional one-to-one prefetch

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

Andrus Adamchik commented on CAY-1695:
--------------------------------------

Some random info so far:

A single Painting object's to-one property transformation during prefetch processing:

1. writePropertyDirectly.. org.apache.cayenne.access.ToOneFault@19de041e
2. writePropertyDirectly.. {<ObjectId:PaintingInfo, PAINTING_ID=6>; committed; [imageBlob=>null; runtimeRelationship0=>?; runtimeRelationship1=>?; textReview=>xYs; painting=>?]}
3. writePropertyDirectly.. org.apache.cayenne.access.ToOneFault@19de041e
4. writePropertyDirectly.. null

The last null  (#4) is introduced inside 'PrefetchProcessorNode.clearNullRelationships' because at step #3 relationship was reset to Fault. So if we can avoid #3, all should be good.
                
> Unexpected null value in bidirectional one-to-one prefetch
> ----------------------------------------------------------
>
>                 Key: CAY-1695
>                 URL: https://issues.apache.org/jira/browse/CAY-1695
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Andrei Veprev
>             Fix For: 3.2M1
>
>         Attachments: 0001-CAY-1695-Unexpected-null-value-in-bidirectional-one-.patch, CAY-1695-test.patch
>
>
> For example you have User and UserInfo entities. User has one-to-one relationship with UserInfo. If you try to do select for User with prefetching on userInfo and userInfo.user, you will get null value for userInfo property:
> SelectQuery query = new SelectQuery(User.class);
> query.addPrefetch("userInfo");
> query.addPrefetch("userInfo.user");
> It doest meter which kind of prefetching do you use. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira