Skip to content

Commit

Permalink
This fix #320
Browse files Browse the repository at this point in the history
- Check if featureOfInterest and relatedFeature are not the same to avoid self-referencing in featurerelation table
  • Loading branch information
CarstenHollmann committed Sep 17, 2015
1 parent 5090109 commit 37833d0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@ public void checkOrInsertFeatureOfInterestRelatedFeatureRelation(final FeatureOf
new RelatedFeatureDAO().getRelatedFeatureForOffering(offering.getIdentifier(), session);
if (CollectionHelper.isNotEmpty(relatedFeatures)) {
for (final RelatedFeature relatedFeature : relatedFeatures) {
insertFeatureOfInterestRelationShip((TFeatureOfInterest) relatedFeature.getFeatureOfInterest(),
featureOfInterest, session);
if (!featureOfInterest.getIdentifier().equals(relatedFeature.getFeatureOfInterest().getIdentifier())) {
insertFeatureOfInterestRelationShip((TFeatureOfInterest) relatedFeature.getFeatureOfInterest(),
featureOfInterest, session);
}
}
}
}
Expand Down

0 comments on commit 37833d0

Please sign in to comment.