@Test void testIsInversedBy() { EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("MyEntityTypeId").getMock(); EntityType refEntityType = mock(EntityType.class); Attribute attribute = factory.create("MyAttributeId"); attribute.setName("MyAttributeName"); attribute.setEntity(entityType); attribute.setDataType(XREF); attribute.setRefEntity(refEntityType); Attribute mappedByAttr = factory.create("MyMappedByAttributeId"); mappedByAttr.setName("MyAttributeName"); mappedByAttr.setEntity(refEntityType); mappedByAttr.setDataType(ONE_TO_MANY); mappedByAttr.setRefEntity(entityType); mappedByAttr.setMappedBy(attribute); when(refEntityType.getAtomicAttributes()).thenReturn(singletonList(mappedByAttr)); assertTrue(attribute.isInversedBy()); }
public boolean isInversedBy() { return getInversedBy() != null; }
Attribute extends StaticEntity implements Labeled { public boolean isInversedBy() { return getInversedBy() != null; } }
Attribute extends StaticEntity implements Labeled { public boolean isInversedBy() { return getInversedBy() != null; } Attribute(Entity entity);  Attribute(EntityType entityType);  Attribute(String attrId, EntityType entityType); }
Attribute extends StaticEntity implements Labeled { public boolean isInversedBy() { return getInversedBy() != null; } Attribute(Entity entity);  Attribute(EntityType entityType);  Attribute(String attrId, EntityType entityType); static Attribute newInstance(
      Attribute attrMeta, AttributeCopyMode attrCopyMode, AttributeFactory attrFactory); String getIdentifier(); Attribute setIdentifier(String identifier); String getName(); Attribute setName(String name); Integer getSequenceNumber(); Attribute setSequenceNumber(int seqNr); EntityType getEntity(); Attribute setEntity(EntityType entityMeta); boolean isIdAttribute(); Attribute setIdAttribute(Boolean isIdAttr); boolean isLabelAttribute(); Attribute setLabelAttribute(Boolean isLabelAttr); @Nullable @CheckForNull Integer getLookupAttributeIndex(); Attribute setLookupAttributeIndex(Integer lookupAttrIdx); @Nullable @CheckForNull String getLabel(); @Nullable @CheckForNull String getLabel(String languageCode); Attribute setLabel(String label); Attribute setLabel(String languageCode, String label); @Nullable @CheckForNull String getDescription(); @Nullable @CheckForNull String getDescription(String languageCode); Attribute setDescription(String description); Attribute setDescription(String languageCode, String description); AttributeType getDataType(); Attribute setDataType(AttributeType dataType); @Nullable @CheckForNull Boolean getCascadeDelete(); Attribute setCascadeDelete(Boolean isCascadeDelete); Iterable<Attribute> getChildren(); boolean hasRefEntity(); EntityType getRefEntity(); Attribute setRefEntity(EntityType refEntity); @Nullable @CheckForNull Attribute getMappedBy(); Attribute setMappedBy(Attribute mappedByAttr); boolean isMappedBy(); @Nullable @CheckForNull Sort getOrderBy(); Attribute setOrderBy(Sort sort); @Nullable @CheckForNull String getExpression(); Attribute setExpression(String expression); boolean hasExpression(); boolean isNillable(); Attribute setNillable(boolean nillable); boolean isAuto(); Attribute setAuto(boolean auto); boolean isVisible(); Attribute setVisible(boolean visible); boolean isAggregatable(); Attribute setAggregatable(boolean isAggregatable); List<String> getEnumOptions(); Attribute setEnumOptions(Class<? extends Enum<?>> e); Attribute setEnumOptions(List<String> enumOptions); @Nullable @CheckForNull Long getRangeMin(); Attribute setRangeMin(Long rangeMin); @Nullable @CheckForNull Long getRangeMax(); Attribute setRangeMax(Long rangeMax); boolean isReadOnly(); Attribute setReadOnly(boolean readOnly); boolean isUnique(); Attribute setUnique(boolean unique); @Nullable @CheckForNull String getNullableExpression(); Attribute setNullableExpression(String nullableExpression); @Nullable @CheckForNull String getVisibleExpression(); Attribute setVisibleExpression(String visibleExpression); @Nullable @CheckForNull String getValidationExpression(); Attribute setValidationExpression(String validationExpression); boolean hasDefaultValue(); @Nullable @CheckForNull String getDefaultValue(); Attribute setDefaultValue(String defaultValue); Range getRange(); Attribute setRange(Range range); @Nullable @CheckForNull Attribute getParent(); Attribute setParent(Attribute parentAttr); Attribute getChild(String attrName); Iterable<Tag> getTags(); Attribute setTags(Iterable<Tag> tags); void addTag(Tag tag); void removeTag(Tag tag); void setDefaultValues(); @Override String toString(); Attribute getInversedBy(); boolean isInversedBy(); }
Attribute extends StaticEntity implements Labeled { public boolean isInversedBy() { return getInversedBy() != null; } Attribute(Entity entity);  Attribute(EntityType entityType);  Attribute(String attrId, EntityType entityType); static Attribute newInstance(
      Attribute attrMeta, AttributeCopyMode attrCopyMode, AttributeFactory attrFactory); String getIdentifier(); Attribute setIdentifier(String identifier); String getName(); Attribute setName(String name); Integer getSequenceNumber(); Attribute setSequenceNumber(int seqNr); EntityType getEntity(); Attribute setEntity(EntityType entityMeta); boolean isIdAttribute(); Attribute setIdAttribute(Boolean isIdAttr); boolean isLabelAttribute(); Attribute setLabelAttribute(Boolean isLabelAttr); @Nullable @CheckForNull Integer getLookupAttributeIndex(); Attribute setLookupAttributeIndex(Integer lookupAttrIdx); @Nullable @CheckForNull String getLabel(); @Nullable @CheckForNull String getLabel(String languageCode); Attribute setLabel(String label); Attribute setLabel(String languageCode, String label); @Nullable @CheckForNull String getDescription(); @Nullable @CheckForNull String getDescription(String languageCode); Attribute setDescription(String description); Attribute setDescription(String languageCode, String description); AttributeType getDataType(); Attribute setDataType(AttributeType dataType); @Nullable @CheckForNull Boolean getCascadeDelete(); Attribute setCascadeDelete(Boolean isCascadeDelete); Iterable<Attribute> getChildren(); boolean hasRefEntity(); EntityType getRefEntity(); Attribute setRefEntity(EntityType refEntity); @Nullable @CheckForNull Attribute getMappedBy(); Attribute setMappedBy(Attribute mappedByAttr); boolean isMappedBy(); @Nullable @CheckForNull Sort getOrderBy(); Attribute setOrderBy(Sort sort); @Nullable @CheckForNull String getExpression(); Attribute setExpression(String expression); boolean hasExpression(); boolean isNillable(); Attribute setNillable(boolean nillable); boolean isAuto(); Attribute setAuto(boolean auto); boolean isVisible(); Attribute setVisible(boolean visible); boolean isAggregatable(); Attribute setAggregatable(boolean isAggregatable); List<String> getEnumOptions(); Attribute setEnumOptions(Class<? extends Enum<?>> e); Attribute setEnumOptions(List<String> enumOptions); @Nullable @CheckForNull Long getRangeMin(); Attribute setRangeMin(Long rangeMin); @Nullable @CheckForNull Long getRangeMax(); Attribute setRangeMax(Long rangeMax); boolean isReadOnly(); Attribute setReadOnly(boolean readOnly); boolean isUnique(); Attribute setUnique(boolean unique); @Nullable @CheckForNull String getNullableExpression(); Attribute setNullableExpression(String nullableExpression); @Nullable @CheckForNull String getVisibleExpression(); Attribute setVisibleExpression(String visibleExpression); @Nullable @CheckForNull String getValidationExpression(); Attribute setValidationExpression(String validationExpression); boolean hasDefaultValue(); @Nullable @CheckForNull String getDefaultValue(); Attribute setDefaultValue(String defaultValue); Range getRange(); Attribute setRange(Range range); @Nullable @CheckForNull Attribute getParent(); Attribute setParent(Attribute parentAttr); Attribute getChild(String attrName); Iterable<Tag> getTags(); Attribute setTags(Iterable<Tag> tags); void addTag(Tag tag); void removeTag(Tag tag); void setDefaultValues(); @Override String toString(); Attribute getInversedBy(); boolean isInversedBy();  }