/**
  * See ConcreteTreeRepNode.makeChildren
  *
  * @param nodeSet
  * @param leafSet
  * @return
  */
 @Override
 protected boolean makeChildren(MutableSet<TreeRepNode> nodeSet, Set<TreeRepNode> leafSet) {
   // format_field has one or more format_enums inside
   if (!formatField.getFormatEnums().isEmpty()) {
     for (Object formEnumObj : formatField.getFormatEnums().getItems()) {
       FormatEnum formEnum = (FormatEnum) formEnumObj;
       FormatEnumNode.addInstance(formEnum, this, nodeSet, leafSet);
     }
     return true;
   } else {
     return false;
   }
 }
  /**
   * See ConcreteTreeRepNode.getDependantsInDatabase
   *
   * @param hbSession
   * @return
   */
  @Override
  public List<TreeRepNode> getDependantsInDatabase(Session hbSession) {
    ArrayList<TreeRepNode> dependants = new ArrayList<TreeRepNode>();

    // format fields are used by variable format fields

    // find variable format fields in database
    String queryVariableFormatFields =
        "select varFormatField from VariableFormatField varFormatField "
            + "join varFormatField.formatField formatField "
            + "where formatField.id=:ID";

    Query hibQuery = hbSession.createQuery(queryVariableFormatFields);
    hibQuery.setParameter("ID", formatField.getID());

    List variableFormatFields = hibQuery.list();

    // create node wrapping each found record.
    for (Object obj : variableFormatFields) {
      dependants.add(
          new VariableFormatFieldNode(DeepDeleteUtil.getProxyImpl((VariableFormatField) obj)));
    }

    return dependants;
  }
 /**
  * Create a FormatFieldNode wrapping the given FormatField element.
  *
  * @param element
  */
 FormatFieldNode(FormatField element) {
   super(element, element.getID(), "FormatField", "FormatField (nameless)");
   formatField = element;
 }