@Transactional
  public void create(Set<GroupEntity> groups) {
    for (GroupEntity group: groups) {
      group.setGroupName(group.getGroupName().toLowerCase());
      entityManagerProvider.get().persist(group);
    }
  }
Find the group entity for the given admin principal entity.

@param principal the principal entity

@return the matching gropu entity
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/GroupDAO.java