@Test public void checkGetDeepComplexPropertyReturnsExternalName() throws ODataJPAModelException { final IntermediateStructuredType<CollectionSecondLevelComplex> st = new IntermediateComplexType<>(nameBuilder, helper.getComplexType("CollectionSecondLevelComplex"), helper.schema); for (final JPACollectionAttribute collection : st.getDeclaredCollectionAttributes()) if (collection.getInternalName().equals("comment")) assertEquals("Comment", collection.asAssociation() .getAlias()); final IntermediateStructuredType<CollectionFirstLevelComplex> stst = new IntermediateComplexType<>(nameBuilder, helper.getComplexType("CollectionFirstLevelComplex"), helper.schema); for (final JPAPath collection : stst.getCollectionAttributesPath()) if (collection.getLeaf().getInternalName().equals("comment")) assertEquals("SecondLevel/Comment", collection .getAlias()); }
@Override public JPAAssociationPath asAssociation() throws ODataJPAModelException { if (this.associationPath == null) this.associationPath = new JPAAssociationPathImpl(this, sourceType, path == null ? sourceType.getPath( getExternalName()) : path, ((IntermediateCollectionTable) getJoinTable()).getLeftJoinColumns()); return associationPath; }
IntermediateCollectionProperty extends IntermediateProperty implements JPACollectionAttribute,
    JPAAssociationAttribute { @Override public JPAAssociationPath asAssociation() throws ODataJPAModelException { if (this.associationPath == null) this.associationPath = new JPAAssociationPathImpl(this, sourceType, path == null ? sourceType.getPath( getExternalName()) : path, ((IntermediateCollectionTable) getJoinTable()).getLeftJoinColumns()); return associationPath; } }
IntermediateCollectionProperty extends IntermediateProperty implements JPACollectionAttribute,
    JPAAssociationAttribute { @Override public JPAAssociationPath asAssociation() throws ODataJPAModelException { if (this.associationPath == null) this.associationPath = new JPAAssociationPathImpl(this, sourceType, path == null ? sourceType.getPath( getExternalName()) : path, ((IntermediateCollectionTable) getJoinTable()).getLeftJoinColumns()); return associationPath; } IntermediateCollectionProperty(final IntermediateCollectionProperty original,
      final IntermediateStructuredType<?> parent, final IntermediateProperty pathRoot);   IntermediateCollectionProperty(final JPAEdmNameBuilder nameBuilder,
      final PluralAttribute<?, ?, ?> jpaAttribute, final IntermediateSchema schema,
      final IntermediateStructuredType<?> parent); }
IntermediateCollectionProperty extends IntermediateProperty implements JPACollectionAttribute,
    JPAAssociationAttribute { @Override public JPAAssociationPath asAssociation() throws ODataJPAModelException { if (this.associationPath == null) this.associationPath = new JPAAssociationPathImpl(this, sourceType, path == null ? sourceType.getPath( getExternalName()) : path, ((IntermediateCollectionTable) getJoinTable()).getLeftJoinColumns()); return associationPath; } IntermediateCollectionProperty(final IntermediateCollectionProperty original,
      final IntermediateStructuredType<?> parent, final IntermediateProperty pathRoot);   IntermediateCollectionProperty(final JPAEdmNameBuilder nameBuilder,
      final PluralAttribute<?, ?, ?> jpaAttribute, final IntermediateSchema schema,
      final IntermediateStructuredType<?> parent); @Override JPAAssociationPath asAssociation(); @Override JPAAssociationAttribute getPartner(); @Override JPAAssociationPath getPath(); @Override JPAAttribute getTargetAttribute(); @Override JPAStructuredType getTargetEntity(); @Override boolean isAssociation(); @Override boolean isCollection(); @Override boolean isComplex(); @Override boolean isEtag(); @Override boolean isKey(); @Override boolean isSearchable(); }
IntermediateCollectionProperty extends IntermediateProperty implements JPACollectionAttribute,
    JPAAssociationAttribute { @Override public JPAAssociationPath asAssociation() throws ODataJPAModelException { if (this.associationPath == null) this.associationPath = new JPAAssociationPathImpl(this, sourceType, path == null ? sourceType.getPath( getExternalName()) : path, ((IntermediateCollectionTable) getJoinTable()).getLeftJoinColumns()); return associationPath; } IntermediateCollectionProperty(final IntermediateCollectionProperty original,
      final IntermediateStructuredType<?> parent, final IntermediateProperty pathRoot);   IntermediateCollectionProperty(final JPAEdmNameBuilder nameBuilder,
      final PluralAttribute<?, ?, ?> jpaAttribute, final IntermediateSchema schema,
      final IntermediateStructuredType<?> parent); @Override JPAAssociationPath asAssociation(); @Override JPAAssociationAttribute getPartner(); @Override JPAAssociationPath getPath(); @Override JPAAttribute getTargetAttribute(); @Override JPAStructuredType getTargetEntity(); @Override boolean isAssociation(); @Override boolean isCollection(); @Override boolean isComplex(); @Override boolean isEtag(); @Override boolean isKey(); @Override boolean isSearchable();  }