private void cullEntries(List<ProtectionEntry> entries, ConnectionWrapper cw) throws SQLException
	{
		ProtectionEntry toDelete = null;
		do
		{
			toDelete = null;
			outerLoop: for (ProtectionEntry entry : entries)
			{
				List<ProtectionEntry> referencers = this.listAllDependingEntries(entry, cw);
				for (ProtectionEntry ref : referencers)
				{
					if (ref.getPropertyId() == null)
					{
						// external reference, object can't be deleted
						// remove it
						toDelete = entry;
						break outerLoop;
					}
					// check all non-self-referencing entries
					if (!ref.equals(entry))
					{
						if (!entries.contains(ref))
						{
							// the object has a reference that is not in the
							// list,
							// remove it
							toDelete = entry;
							// break the loop
							break outerLoop;
						}
					}
				}
			}
			if (toDelete != null)
			{
				entries.remove(toDelete);
			}
		} while (toDelete != null);
	}