We've got a problem with the EntityBuilder
when creating an entity. The builder is not resolving to the right entityClass
when more than one entity class has been declared with the same entityName
.
I show an example:
SCHEMA LINK
- rootName
Content
- field:
Seo
(ComponentLink to Seo)
SCHEMA SEO
- rootName
Content
JAVA ENTITIES
@SemanticEntity(entityName = "Content", vocabulary = SDL_CORE, prefix = "tri")
public class Seo extends AbstractEntityModel
@SemanticEntity(entityName = "Content", vocabulary = SDL_CORE, prefix = "tri")
public class Link extends AbstractEntityModel
When creating the entity for the component Link, the componentLink
field seo
has to be resolved. The problem is that the entityClass
is resolved against Link
but not Seo
entity.
The function getEntityClassByFullyQualifiedName
looks up http://www.sdl.com/web/schemas/core:Content
iterating over all the semantics with the node Content
. The function finds both entities: Link
and Seo
, but this function always returns the first element:
this.semanticMappingRegistry.getEntityClassByFullyQualifiedName(semanticTypeName)
QUESTION
- Is this a bug or a misconfiguration issue?