AbstractAttribute implements Attribute<X, Y> { @Override public boolean hasLanguage() { return language != null && !simpleLiteral && !lexicalForm && attributeType != PersistentAttributeType.OBJECT; } AbstractAttribute(AbstractAttributeBuilder<X, Y> builder); @Override PersistentAttributeType getPersistentAttributeType(); @Override Member getJavaMember(); @Override IRI getIRI(); @Override CascadeType[] getCascadeTypes(); @Override boolean isNonEmpty(); @Override ParticipationConstraint[] getConstraints(); @Override ManagedType<X> getDeclaringType(); @Override Field getJavaField(); @Override FetchType getFetchType(); @Override boolean isInferred(); @Override boolean includeExplicit(); @Override boolean isLexicalForm(); @Override boolean isSimpleLiteral(); @Override boolean hasLanguage(); @Override String getLanguage(); @Override String getName(); ConverterWrapper getConverter(); @Override String toString();  }
@Test void hasLanguageReturnsFalseWhenAttributeIsSimpleLiteral() throws Exception { final PropertyAttributes pa = PropertyAttributes .create(OWLClassA.getStrAttField(), new FieldMappingValidator(), new TypeBuilderContext<>(metamodelMocks.forOwlClassA().entityType(), new NamespaceResolver())); pa.simpleLiteral = true; pa.language = LANG; final SingularAttribute<?, ?> sut = SingularAttributeImpl.builder(pa).build(); assertFalse(sut.hasLanguage()); }
@Test void hasLanguageReturnsFalseWhenAttributeIsLexicalFormOnly() throws Exception { final PropertyAttributes pa = PropertyAttributes .create(OWLClassA.getStrAttField(), new FieldMappingValidator(), new TypeBuilderContext<>(metamodelMocks.forOwlClassA().entityType(), new NamespaceResolver())); pa.lexicalForm = true; pa.language = LANG; final SingularAttribute<?, ?> sut = SingularAttributeImpl.builder(pa).build(); assertFalse(sut.hasLanguage()); }
@Test void hasLanguageReturnsFalseForObjectPropertyAttribute() throws Exception { final PropertyAttributes pa = PropertyAttributes .create(OWLClassD.getOwlClassAField(), new FieldMappingValidator(), new TypeBuilderContext<>(metamodelMocks.forOwlClassD().entityType(), new NamespaceResolver())); pa.persistentAttributeType = Attribute.PersistentAttributeType.OBJECT; pa.language = LANG; final SingularAttribute<?, ?> sut = SingularAttributeImpl.builder(pa).build(); assertFalse(sut.hasLanguage()); }