@Transactional
  public KerberosPrincipalEntity create(String principalName, boolean service) {
    KerberosPrincipalEntity kpe = new KerberosPrincipalEntity(principalName, service, null);
    create(kpe);
    return kpe;
  }
Make an instance managed and persistent.

@param principalName the principal name to use when creating a new KerberosPrincipalEntity to
                     store
@param service       a boolean value declaring whether the principal represents a service (true) or not )false).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalDAO.java