code: @SuppressWarnings("unchecked")
      @Override
      public Map getConstrainedProperties() {
          verifyContextIsInitialized();
          if(constrainedProperties == null) {
              ConstrainedDiscovery constrainedDiscovery = GrailsFactoriesLoader.loadFactory(ConstrainedDiscovery.class);
              if(constrainedDiscovery == null) {
                  constrainedProperties = Collections.emptyMap();
              }
              else {
                  constrainedProperties = constrainedDiscovery.findConstrainedProperties(persistentEntity);
              }
          }
          return constrainedProperties;
      }
docs: /* (non-Javadoc)
  @see grails.core.GrailsDomainClass#getConstraints()