You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "mibo (Jira)" <ji...@apache.org> on 2022/04/24 06:20:00 UTC
[jira] [Updated] (OLINGO-1384) AnnotationInMemoryDs: deep Create throws "Missing source field for related data"
[ https://issues.apache.org/jira/browse/OLINGO-1384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
mibo updated OLINGO-1384:
-------------------------
Fix Version/s: V2 2.0.13
(was: V2 2.0.12)
> AnnotationInMemoryDs: deep Create throws "Missing source field for related data"
> --------------------------------------------------------------------------------
>
> Key: OLINGO-1384
> URL: https://issues.apache.org/jira/browse/OLINGO-1384
> Project: Olingo
> Issue Type: Bug
> Components: odata2-annotation
> Affects Versions: V2 2.0.2, V2 2.0.3, V2 2.0.4, V2 2.0.5, V2 2.0.6, V2 2.0.7, V2 2.0.8, V2 2.0.9, V2 2.0.10, V2 2.0.11
> Reporter: Carsten Milkau
> Priority: Minor
> Labels: newbie, patch
> Fix For: V2 2.0.13
>
> Attachments: odata2-annotation-processor-deep-create-unidir.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When a deep create on a source entity follows a navigation property but no corresponding back-navigation at the target entity is found, AnnotationInMemoryDs throws the error "Missing source field for related data". There are two possible reasons no target navigation is found:
> # It doesn't exist
> # The target entity is of the same type as the source entity ("self-reference")
> *Steps to reproduce:*
> # Checkout cars-annotation-archetype
> # Remove property "Car" of entity type "Driver"
> # Run example service
> # Click "create example data"
> *Expected results:*
> Example data, including drivers, is created.
> *Actual results:*
> Car creation fails when it mentions a driver, no drivers are created nor cars that have a driver. Each create request logs "Missing source field for related data".
> *Workaround:*
> # Always create a corresponding back-navigation property at the target entity of a navigation when using deep creates.
> # Don't use deep create when target entity type = source entity type.
> *Additional information:*
> # A similar fix as this one is already present in readRelatedData()
> # Patch does not include a test (yet) for this special case. I would need some assistance regarding conventions and options.
> # Bug was introduced in [6f7b76f689e4a8c8889c59760715c80d4a4c17f2|https://github.com/apache/olingo-odata2/commit/6f7b76f689e4a8c8889c59760715c80d4a4c17f2] of issue OLINGO-508. IMHO that change broke more than it fixed (expect at least one more related bug), but see #1.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)