@Test public void testAddJPAEdmAssociationView() { class LocalJPAAssociationView extends JPAEdmTestModelView { @Override public AssociationEnd getEdmAssociationEnd1() { AssociationEnd associationEnd = new AssociationEnd(); associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader")); associationEnd.setRole("SalesOrderHeader"); associationEnd.setMultiplicity(EdmMultiplicity.ONE); return associationEnd; } @Override public AssociationEnd getEdmAssociationEnd2() { AssociationEnd associationEnd = new AssociationEnd(); associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderItem")); associationEnd.setRole("SalesOrderItem"); associationEnd.setMultiplicity(EdmMultiplicity.MANY); return associationEnd; } @Override public Association getEdmAssociation() { Association association = new Association(); association.setEnd1(new AssociationEnd().setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader"))); association.setEnd2(new AssociationEnd() .setType(new FullQualifiedName("salesorderprocessing", "SalesOrderItem"))); return association; } } LocalJPAAssociationView assocViewObj = new LocalJPAAssociationView(); JPAEdmAssociation objLocalAssociation = new JPAEdmAssociation(assocViewObj, assocViewObj, assocViewObj, 1); try { objLocalAssociation.getBuilder().build(); } catch (ODataJPARuntimeException e) { fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); } catch (ODataJPAModelException e) { fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); } objAssociation.addJPAEdmAssociationView(objLocalAssociation, localView); }
@Override public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) { if (associationView != null) { currentAssociation = associationView.getEdmAssociation(); associationMap.put(currentAssociation.getName(), currentAssociation); associationEndMap.put(currentAssociation.getName(), associationEndView); addJPAEdmRefConstraintView(associationView.getJPAEdmReferentialConstraintView()); } }
JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssociationView { @Override public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) { if (associationView != null) { currentAssociation = associationView.getEdmAssociation(); associationMap.put(currentAssociation.getName(), currentAssociation); associationEndMap.put(currentAssociation.getName(), associationEndView); addJPAEdmRefConstraintView(associationView.getJPAEdmReferentialConstraintView()); } } }
JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssociationView { @Override public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) { if (associationView != null) { currentAssociation = associationView.getEdmAssociation(); associationMap.put(currentAssociation.getName(), currentAssociation); associationEndMap.put(currentAssociation.getName(), associationEndView); addJPAEdmRefConstraintView(associationView.getJPAEdmReferentialConstraintView()); } } JPAEdmAssociation(final JPAEdmAssociationEndView associationEndview,
      final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final int value);  JPAEdmAssociation(final JPAEdmSchemaView view); }
JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssociationView { @Override public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) { if (associationView != null) { currentAssociation = associationView.getEdmAssociation(); associationMap.put(currentAssociation.getName(), currentAssociation); associationEndMap.put(currentAssociation.getName(), associationEndView); addJPAEdmRefConstraintView(associationView.getJPAEdmReferentialConstraintView()); } } JPAEdmAssociation(final JPAEdmAssociationEndView associationEndview,
      final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final int value);  JPAEdmAssociation(final JPAEdmSchemaView view); @Override JPAEdmBuilder getBuilder(); @Override Association getEdmAssociation(); @Override List<Association> getConsistentEdmAssociationList(); @Override Association searchAssociation(final JPAEdmAssociationEndView view); @Override void addJPAEdmAssociationView(final JPAEdmAssociationView associationView,
      final JPAEdmAssociationEndView associationEndView); @Override void addJPAEdmRefConstraintView(final JPAEdmReferentialConstraintView refView); @Override JPAEdmReferentialConstraintView getJPAEdmReferentialConstraintView(); @Override int getNumberOfAssociationsWithSimilarEndPoints(final JPAEdmAssociationEndView view); }
JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssociationView { @Override public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) { if (associationView != null) { currentAssociation = associationView.getEdmAssociation(); associationMap.put(currentAssociation.getName(), currentAssociation); associationEndMap.put(currentAssociation.getName(), associationEndView); addJPAEdmRefConstraintView(associationView.getJPAEdmReferentialConstraintView()); } } JPAEdmAssociation(final JPAEdmAssociationEndView associationEndview,
      final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final int value);  JPAEdmAssociation(final JPAEdmSchemaView view); @Override JPAEdmBuilder getBuilder(); @Override Association getEdmAssociation(); @Override List<Association> getConsistentEdmAssociationList(); @Override Association searchAssociation(final JPAEdmAssociationEndView view); @Override void addJPAEdmAssociationView(final JPAEdmAssociationView associationView,
      final JPAEdmAssociationEndView associationEndView); @Override void addJPAEdmRefConstraintView(final JPAEdmReferentialConstraintView refView); @Override JPAEdmReferentialConstraintView getJPAEdmReferentialConstraintView(); @Override int getNumberOfAssociationsWithSimilarEndPoints(final JPAEdmAssociationEndView view);  }