/** * Gets the list of internal part of many-to-many child neighbor configurations. * * @return list of internal part of many-to-many child neighbor configurations */ public List<NeighborConfig> getInternalManyToManyChildConfigList() { List<NeighborConfig> neighborConfigList = new ArrayList<NeighborConfig>(); for (NeighborConfig neighborConfig : getList()) { ConceptConfig destinationConceptConfig = neighborConfig.getDestinationConceptConfig(); if (destinationConceptConfig.isManyToMany()) { if (neighborConfig.isInternal() && neighborConfig.isChild() && neighborConfig.isPartOfManyToMany()) { neighborConfigList.add(neighborConfig); } } } return neighborConfigList; }
/** * Checks if the new neighbor code is unique within the concept including properties. * * @param newNeighborConfig neighbor configuration entity * @return <code>true</code> if the add precondition is satisfied */ protected boolean preAdd(NeighborConfig newNeighborConfig) { boolean validation = true; String newNeighborCode = newNeighborConfig.getCode(); if (newNeighborCode != null) { for (NeighborConfig neighborConfig : this) { if (neighborConfig.getCode().equals(newNeighborCode)) { validation = false; log.info(newNeighborCode + " neighbor code must be unique within the concept."); break; } } for (PropertyConfig propertyConfig : conceptConfig.getPropertiesConfig()) { if (propertyConfig.getCode().equals(newNeighborCode)) { validation = false; log.info( newNeighborCode + " neighbor code must be unique within the concept including properties."); break; } } } else { validation = false; log.info("Neighbor code is required."); } return validation; }