Remove a specific relationship from the GeoPackage

@param extendedRelation
extended relation
494963
public void removeRelationship(ExtendedRelation extendedRelation) {

		try {
			if (extendedRelationsDao.isTableExists()) {
				geoPackage.deleteTable(extendedRelation.getMappingTableName());
				extendedRelationsDao.delete(extendedRelation);
			}
		} catch (SQLException e) {
			throw new GeoPackageException("Failed to remove relationship '"
					+ extendedRelation.getRelationName() + "' between "
					+ extendedRelation.getBaseTableName() + " and "
					+ extendedRelation.getRelatedTableName()
					+ " with mapping table "
					+ extendedRelation.getMappingTableName(), e);
		}
	}
796380
private static void delete(GeoPackageCore geoPackage) {

		ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();

		try {
			if (extensionsDao.isTableExists()) {
				geoPackage.dropTable(extensionsDao.getTableName());
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete all extensions. GeoPackage: "
							+ geoPackage.getName(), e);
		}

	}
545012
public void removeExtension(String geoPackage) {
		PropertiesCoreExtension<T, ?, ?, ?> properties = propertiesMap
				.get(geoPackage);
		if (properties != null) {
			properties.removeExtension();
		}
	}
1089602
public static void deleteSchemaExtension(GeoPackageCore geoPackage) {

		SchemaExtension schemaExtension = new SchemaExtension(geoPackage);
		if (schemaExtension.has()) {
			schemaExtension.removeExtension();
		}

	}
720677
private static RelatedTablesCoreExtension getRelatedTableExtension(
			GeoPackageCore geoPackage) {
		return new RelatedTablesCoreExtension(geoPackage) {
			@Override
			public String getPrimaryKeyColumnName(String tableName) {
				return null;
			}
		};
	}
699602
public static void deleteGriddedCoverageExtension(GeoPackageCore geoPackage) {

		List<String> coverageTables = geoPackage
				.getTables(ContentsDataType.GRIDDED_COVERAGE);
		for (String table : coverageTables) {
			geoPackage.deleteTable(table);
		}

		GriddedTileDao griddedTileDao = geoPackage.getGriddedTileDao();
		GriddedCoverageDao griddedCoverageDao = geoPackage
				.getGriddedCoverageDao();
		ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();

		try {
			if (griddedTileDao.isTableExists()) {
				geoPackage.dropTable(griddedTileDao.getTableName());
			}
			if (griddedCoverageDao.isTableExists()) {
				geoPackage.dropTable(griddedCoverageDao.getTableName());
			}
			if (extensionsDao.isTableExists()) {
				extensionsDao
						.deleteByExtension(CoverageDataCore.EXTENSION_NAME);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Gridded Coverage extension and tables. GeoPackage: "
							+ geoPackage.getName(), e);
		}

	}
191367
public void delete(String tableName, String geometryColumnName) {

		if (has(tableName, geometryColumnName)) {
			drop(tableName, geometryColumnName);

			try {
				extensionsDao.deleteByExtension(EXTENSION_NAME, tableName,
						geometryColumnName);
			} catch (SQLException e) {
				throw new GeoPackageException(
						"Failed to delete RTree Index extension. GeoPackage: "
								+ geoPackage.getName() + ", Table: "
								+ tableName + ", Geometry Column: "
								+ geometryColumnName, e);
			}
		}

	}
101247
public static void deleteMetadata(GeoPackageCore geoPackage, String table) {

		MetadataReferenceDao metadataReferenceDao = geoPackage
				.getMetadataReferenceDao();
		try {
			if (metadataReferenceDao.isTableExists()) {
				metadataReferenceDao.deleteByTableName(table);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Metadata extension. GeoPackage: "
							+ geoPackage.getName() + ", Table: " + table, e);
		}

	}
492102
function() {
			Backbone.Relational.store.getCollection( this.instance )
				.unbind( 'relational:remove', this._modelRemovedFromCollection );
			
			Backbone.Relational.store.getCollection( this.relatedModel )
				.unbind( 'relational:add', this._relatedModelAdded )
				.unbind( 'relational:remove', this._relatedModelRemoved );
			
			_.each( this.getReverseRelations(), function( relation ) {
					relation.removeRelated( this.instance );
				}, this );
		}
1142186
private void deleteRelation(Object connection, EntityMetadata entityMetadata, String rowKey)
    {
        List<String> relations = entityMetadata.getRelationNames();

        if (relations != null)
        {
            for (String relation : relations)
            {
                if (resource != null && resource.isActive())
                {
                    ((Transaction) connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey), relation);

                }
                else
                {
                    ((Pipeline) connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey), relation);

                }
            }

        }
        /*
         * Response<Map<String, String>> fields = null; if (resource != null &&
         * resource.isActive()) { fields = ((Transaction)
         * connection).hgetAll(getHashKey(entityMetadata.getTableName(),
         * rowKey)); if (connection != null) { ((Pipeline) connection).sync(); }
         * for (String field : fields.get().keySet()) { ((Transaction)
         * connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey),
         * field); } } else { fields = ((Pipeline)
         * connection).hgetAll(getHashKey(entityMetadata.getTableName(),
         * rowKey)); if (connection != null) { ((Pipeline) connection).sync(); }
         * for (String field : fields.get().keySet()) { ((Pipeline)
         * connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey),
         * field); } }
         */
    }
1249874
@Override
	public boolean includeRelation(SRelation relation) {
		Map<String, Set<String>> displayedRelAnnotations = new HashMap<String, Set<String>>();

		// if no configuration set output the relation
		if (relation instanceof SPointingRelation) {
			if (configurations.get(1) == null) {
				return true;
			} else {
				displayedRelAnnotations = displayedPointingRelAnnotations;
			}
		}

		if (relation instanceof SSpanningRelation) {
			if (configurations.get(2) == null) {
				return true;
			} else {
				displayedRelAnnotations = displayedSpanningRelAnnotations;
			}
		}

		if (relation instanceof SDominanceRelation) {
			if (configurations.get(3) == null) {
				return true;
			} else {
				displayedRelAnnotations = displayedDominanceRelAnnotations;
			}
		}

		Set<SAnnotation> relAnnotations = relation.getAnnotations();

		return includeObject(relAnnotations, displayedRelAnnotations);
	}
132849
public void remove(Relationship relationship) {
        if (relationship != null) {
            RelationshipView relationshipView = new RelationshipView(relationship);
            relationshipViews.remove(relationshipView);
        }
    }
1201557
public static void deleteFeatureStyle(GeoPackageCore geoPackage,
			String table) {

		FeatureCoreStyleExtension featureStyleExtension = getFeatureStyleExtension(geoPackage);
		if (featureStyleExtension.has(table)) {
			featureStyleExtension.deleteRelationships(table);
		}

	}
551999
public List<ExtendedRelation> getRelations(String baseTable,
			String relatedTable) throws SQLException {
		return getRelations(baseTable, null, relatedTable, null, null, null);
	}
736978
public static void deleteContentsIdExtension(GeoPackageCore geoPackage) {

		ContentsIdExtension contentsIdExtension = new ContentsIdExtension(
				geoPackage);
		if (contentsIdExtension.has()) {
			contentsIdExtension.removeExtension();
		}

	}
513603
@Override
	public void removeAssociationRow(GraphDatabaseService executionEngine, AssociationKey associationKey, RowKey rowKey) {
		Object[] queryValues = relationshipValues( associationKey, rowKey );
		executionEngine.execute( removeAssociationRowQuery, params( queryValues ) );
	}
1207030
public function removeAddressRelation($contact, $contactAddress)
    {
        if (!$contact || !$contactAddress) {
            throw new \Exception('Contact and ContactAddress cannot be null');
        }

        // reload address to get all data (including relational data)
        /** @var Address $address */
        $address = $contactAddress->getAddress();
        $address = $this->em->getRepository(
            'SuluContactBundle:Address'
        )->findById($address->getId());

        $isMain = $contactAddress->getMain();

        // remove relation
        $contact->removeContactAddress($contactAddress);
        $address->removeContactAddress($contactAddress);

        // if was main, set a new one
        if ($isMain) {
            $this->setMainForCollection($contact->getContactAddresses());
        }

        // delete address if it has no more relations
        if (!$address->hasRelations()) {
            $this->em->remove($address);
        }

        $this->em->remove($contactAddress);
    }