Open rpakira opened 5 years ago
Hi. Thanks for reporting this issue. Two process remarks:
Regarding your question: by default, DXA uses the class name as entity name (in the Core Vocabulary). If that default mapping is fine for you, you don't have to add a @SemanticEntity annotation at all (at least not for the Core Vocabulary).
On the other hand, if you do add such a (superfluous) annotation, I would expect it to be silently ignored rather than yielding an "ambiguous semantic mapping" error. So, this sounds like a (minor) defect in the DXA Java Framework implementatation, with an easy work-around.
Thank you very much for your suggestion.
We are facing issue to map some Tridion component field data to EntityModel object. Some components link fields can be linked to different type of components. So, we have used generic type, EntityModel type of field in the SemanticEntity to map data of the linked component. But some of the components are throwing following error:
I have investigated the issue and found that DXA framework is failing to map linked component data to EntityModel object if entities for linked component have “entityName” attribute value same as the class name. As the mapping shown below:
But if we put “entityName” different from class name, as shown below then it is working.
The issue is occurring because DXA framework register both the value that is specified in “entityName” attribute and entity class name as entity. If both the values are same, then DXA framework finds ambiguous semantic mapping (unable to find unique matching entity for model data) and throws exception.
Can you please let me know if it is limitation of DXA framework or we should follow some naming convention for class name and “entityName” attribute?