private void ensureStackIdSet(BlueprintEntity entity) {
    StackEntity stack = entity.getStack();
    if (stack != null && stack.getStackId() == null) {
      entity.setStack(stackDAO.find(stack.getStackName(), stack.getStackVersion()));
    }
  }
Remove entity instance by primary key
@param blueprint_name Primary key: blueprint name
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/BlueprintDAO.java