PluralObjectPropertyStrategy extends FieldStrategy<Y, X> { @Override void addValueFromAxiom(Axiom<?> ax) { final NamedResource valueIdentifier = (NamedResource) ax.getValue().getValue(); if (IdentifierTransformer.isValidIdentifierType(attribute.getBindableJavaType())) { values.add(IdentifierTransformer .transformToIdentifier(valueIdentifier.getIdentifier(), attribute.getBindableJavaType())); } else { final Object value = mapper.getEntityFromCacheOrOntology(attribute.getBindableJavaType(), valueIdentifier.getIdentifier(), entityDescriptor.getAttributeDescriptor(attribute)); if (value != null) { values.add(value); } else { LOG.trace("Value of axiom {} could not be loaded as entity filling attribute {}.", ax, attribute); } } } PluralObjectPropertyStrategy(EntityType<X> et, Y att, Descriptor descriptor, EntityMappingHelper mapper);   }
@Test void addValueFromAxiomGetsAttributeDescriptorFromEntityDescriptorForLoading() throws Exception { final EntityDescriptor aDescriptor = new EntityDescriptor(Generators.createIndividualIdentifier()); descriptor.addAttributeDescriptor(OWLClassJ.getOwlClassAField(), aDescriptor); final PluralObjectPropertyStrategy<?, OWLClassJ> sut = strategy(); final URI aReference = Generators.createIndividualIdentifier(); when(mapperMock.getEntityFromCacheOrOntology(eq(OWLClassA.class), eq(aReference), any(Descriptor.class))) .thenReturn(null); final Axiom<NamedResource> axiom = new AxiomImpl<>(NamedResource.create(ID), Assertion.createObjectPropertyAssertion(URI.create(Vocabulary.P_HAS_A), false), new Value<>( NamedResource.create(aReference))); sut.addValueFromAxiom(axiom); verify(mapperMock).getEntityFromCacheOrOntology(OWLClassA.class, aReference, aDescriptor); }