enumOptions.add(entity.getName());
for (Entity subclass : subclasses)
{
enumOptions.add(subclass.getName());
}
Field type_field = new Field(rootAncestor, new EnumField(), Field.TYPE_FIELD, Field.TYPE_FIELD, true,
false, false, null);
type_field.setDescription("Subtypes of " + entity.getName() + ". Have to be set to allow searching");
type_field.setEnumOptions(enumOptions);
type_field.setHidden(true);
rootAncestor.addField(0, type_field);