Modify @OneToMany entity in Spring Data Rest without its repository
<p>In my project I use object of type <em>A</em> which has OneToMany relation (orphanRemoval = true, cascade = CascadeType.ALL, fetch = FetchType.EAGER) to objects of type <em>B</em>. I need SpringDataRest (SDR) to store complete full <em>A</em> object with its <em>B</em> objects (children) using single one POST request. I tried several combinations in SDR, the only one which worked for me, was to create @RepositoryRestResource for object <em>A</em> and to create @RepositoryRestResource also for object <em>B</em>, but mark this (<em>B</em>) as exported=false (if I did not create repository out of object <em>B</em> at all, it would not work -> just <em>A</em> object would be stored on single POST request, but not its children (@OneToMany relation) of type <em>B</em>; the same outcome occurs if exported=false is omitted for <em>B</em> repository).
 Is this ok and the only way how to achieve it (single POST request with storing all objects at once)?</p>

<p>The reason I'm asking, in my previous example, I have to (I would like to) control all objects "lifecycle" by using <em>A</em>'s repository. I am ok with it, because <em>A</em>-><em>B</em> relation is composition (<em>B</em> does not exists outside of <em>A</em>). But I have serious problem of editing (also removing) one certain object of type <em>B</em> by SDR using its parent repository (since object <em>B</em> doest not have its own repository exported). Maybe, this is not possible by definition. I have tried these solutions:</p>

<ul>
<li>PATCH for "/A/1/B/2" does not work -> method not allowed (in headers
is "Allow: GET, DELETE") -> so, also PUT is out of question</li>
<li>Json Patch would not work either - PATCH for "/A/1" using json patch
content-type [{"op": "add", "path": "/B/2", ....}] -> "no such index
in target array" - because Json Patch uses scalar "2" after "array"
as a index to its array. This is not practical in Java world, when
relations are kept in Set of objects - indexing has no meaning
at all.</li>
<li>I could export repository (exported=true) of object <em>B</em> for
manipulating it "directly", but this way I would loose ability to
store the whole object <em>A</em> with its <em>B</em> objects at one single POST
request as I have mentioned before.</li>
</ul>

<p>I would like to avoid sending the whole <em>A</em> object with one single tiny   modification of its <em>B</em> object for PUT, if possible.
Thank you.</p>