@Override @GraphTransaction public void deleteTrait(String guid,String traitNameToBeDeleted) throws TraitNotFoundException, EntityNotFoundException, RepositoryException {
  LOG.debug("Deleting trait={} from entity={}",traitNameToBeDeleted,guid);
  AtlasVertex instanceVertex=graphHelper.getVertexForGUID(guid);
  List<String> traitNames=GraphHelper.getTraitNames(instanceVertex);
  if (!traitNames.contains(traitNameToBeDeleted)) {
    throw new TraitNotFoundException("Could not find trait=" + traitNameToBeDeleted + " in the repository for entity: "+ guid);
  }
  try {
    final String entityTypeName=GraphHelper.getTypeName(instanceVertex);
    String relationshipLabel=GraphHelper.getTraitLabel(entityTypeName,traitNameToBeDeleted);
    AtlasEdge edge=graphHelper.getEdgeForLabel(instanceVertex,relationshipLabel);
    if (edge != null) {
      deleteHandler.deleteEdgeReference(edge,DataTypes.TypeCategory.TRAIT,false,true);
      traitNames.remove(traitNameToBeDeleted);
      updateTraits(instanceVertex,traitNames);
    }
  }
 catch (  Exception e) {
    throw new RepositoryException(e);
  }
}

@ Override @ GraphTransaction public void deleteTrait ( String guid , String traitNameToBeDeleted ) throws TraitNotFoundException , EntityNotFoundException , RepositoryException { LOG . debug ( "Deleting trait={} from entity={}" , traitNameToBeDeleted , guid ) ; AtlasVertex instanceVertex = graphHelper . getVertexForGUID ( guid ) ; List < String > traitNames = GraphHelper . getTraitNames ( instanceVertex ) ; if ( ! traitNames . contains ( traitNameToBeDeleted ) ) { throw new TraitNotFoundException ( "Could not find trait=" + traitNameToBeDeleted + " in the repository for entity: " + guid ) ; } try { final String entityTypeName = GraphHelper . getTypeName ( instanceVertex ) ; String relationshipLabel = GraphHelper . getTraitLabel ( entityTypeName , traitNameToBeDeleted ) ; AtlasEdge edge = graphHelper . getEdgeForLabel ( instanceVertex , relationshipLabel ) ; if ( edge != null ) { deleteHandler . deleteEdgeReference ( edge , DataTypes . TypeCategory . TRAIT , false , true ) ; traitNames . remove ( traitNameToBeDeleted ) ; updateTraits ( instanceVertex , traitNames ) ; } } catch ( Exception e ) { throw new RepositoryException ( e ) ; } }
deletes a given trait from an existing entity represented by a guid .
