code: public static List<Namespace> findByOwner(EntityManager em, PrincipalUser owner) {
          SystemAssert.requireArgument(em != null, "EntityManager cannot be null.");
          SystemAssert.requireArgument(owner != null, "Owner cannot be null or empty.");
  
          TypedQuery<Namespace> query = em.createNamedQuery("Namespace.findByOwner", Namespace.class);
  
          try {
              return query.setParameter("owner", owner).getResultList();
          } catch (NoResultException ex) {
              return new ArrayList<>(0);
          }
      }
docs: Finds all namespaces for a given owner.
  
  @param   em     The entity manager to use.  Cannot be null.
  @param   owner  The owner for which to retrieve dashboards.  Cannot be null.
  
  @return  The dashboards for the owner.  Will never be null, but may be empty.