viewMapping.setTypeInfo(metadata);
final TagMapping tagMapping = findOrCreateTagMapping(tagName);
tagMapping.getVersionedTagToViewMappings().add(viewMapping);
final Trait trait = MetadataFactory.eINSTANCE.createTrait();
trait.setId(ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID);
trait.setValue(tagMapping);
final Entity entity = MetadataFactory.eINSTANCE.createEntity();
entity.setId(tagName);
entity.setType("tag"); //$NON-NLS-1$
entity.getTraits().add(trait);