[forge-issues] [JBoss JIRA] (FORGE-1277) Allow relationships to be conditionally emitted in REST resource representations

Vineet Reynolds (JIRA) jira-events at lists.jboss.org
Tue Oct 22 11:53:01 EDT 2013


    [ https://issues.jboss.org/browse/FORGE-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12824050#comment-12824050 ] 

Vineet Reynolds commented on FORGE-1277:
----------------------------------------

In my opinion, this is a good addition to have. We should however handle the scenario (or the equivalent ):

If a client issues a GET with a filter parameter (like filterAllWithBooks), then the resource representation should not be used in a subsequent PUT request to update the entity. The resource representation used in such a PUT request would lack certain relationships, and thus such requests would result in incorrect updates.

I believe this could be done via documentation - clients should not be using filtered representations to represent updates in  entities. Also we do not support HTTP PATCH (yet), so we should accept resource representations in whole and not in bits. It may also be necessary to ensure that the relationships are eagerly fetched by default (debatable on whether we should require clients to take the additional step of using the filter parameter to request the complete entity representation).
                
> Allow relationships to be conditionally emitted in REST resource representations
> --------------------------------------------------------------------------------
>
>                 Key: FORGE-1277
>                 URL: https://issues.jboss.org/browse/FORGE-1277
>             Project: Forge
>          Issue Type: Feature Request
>          Components: Builtin Plugins
>            Reporter: Vineet Reynolds
>
> From : http://lists.jboss.org/pipermail/forge-dev/2013-October/003484.html
> When you have too many @OneToMany or @ManyToMany relationships, you end up
> with several queries that JOIN FETCH several/different relationships. So
> what I usually do when things are complex is :
> findAll
> findAllWithRelations (meaning all relations are FETCH)
> or more specific (when things are really really complex)
> findAllWithBooks
> findAllWithAuthors
> findAllWithBooksAndAuthors

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


More information about the forge-issues mailing list