gt:             for (Risk e : getEntities()) {
context: // ----------> GENERATED FILE - DON'T TOUCH! <----------
  
  // generator: ilarkesto.mda.legacy.generator.DaoGenerator
  
  
  
  
  
  
  
  
  
  
  package scrum.server.risks;
  
  import java.util.*;
  import ilarkesto.core.base.Utl;
  import ilarkesto.core.logging.Log;
  import ilarkesto.auth.Auth;
  import ilarkesto.base.Cache;
  import ilarkesto.persistence.EntityEvent;
  import ilarkesto.core.fp.Predicate;
  
  public abstract class GRiskDao
              extends ilarkesto.persistence.ADao<Risk> {
  
      public final String getEntityName() {
          return Risk.TYPE;
      }
  
      public final Class getEntityClass() {
          return Risk.class;
      }
  
      public Set<Risk> getEntitiesVisibleForUser(final scrum.server.admin.User user) {
          return getEntities(new Predicate<Risk>() {
              public boolean test(Risk e) {
                  return Auth.isVisible(e, user);
              }
          });
      }
  
      // --- clear caches ---
      public void clearCaches() {
          risksByProjectCache.clear();
          projectsCache = null;
          risksByNumberCache.clear();
          numbersCache = null;
          risksByLabelCache.clear();
          labelsCache = null;
          risksByDescriptionCache.clear();
          descriptionsCache = null;
          risksByProbabilityMitigationCache.clear();
          probabilityMitigationsCache = null;
          risksByImpactMitigationCache.clear();
          impactMitigationsCache = null;
          risksByProbabilityCache.clear();
          probabilitysCache = null;
          risksByImpactCache.clear();
          impactsCache = null;
      }
  
      @Override
      public void entityDeleted(EntityEvent event) {
          super.entityDeleted(event);
          if (event.getEntity() instanceof Risk) {
              clearCaches();
          }
      }
  
      @Override
      public void entityModified(EntityEvent event) {
          super.entityModified(event);
          if (event.getEntity() instanceof Risk) {
              clearCaches();
          }
      }
  
      // -----------------------------------------------------------
      // - project
      // -----------------------------------------------------------
  
      private final Cache<scrum.server.project.Project,Set<Risk>> risksByProjectCache = new Cache<scrum.server.project.Project,Set<Risk>>(
              new Cache.Factory<scrum.server.project.Project,Set<Risk>>() {
                  public Set<Risk> create(scrum.server.project.Project project) {
                      return getEntities(new IsProject(project));
                  }
              });
  
      public final Set<Risk> getRisksByProject(scrum.server.project.Project project) {
          return new HashSet<Risk>(risksByProjectCache.get(project));
      }
      private Set<scrum.server.project.Project> projectsCache;
  
      public final Set<scrum.server.project.Project> getProjects() {
          if (projectsCache == null) {
              projectsCache = new HashSet<scrum.server.project.Project>();
              for (Risk e : getEntities()) {
                  if (e.isProjectSet()) projectsCache.add(e.getProject());
              }
          }
          return projectsCache;
      }
  
      private static class IsProject implements Predicate<Risk> {
  
          private scrum.server.project.Project value;
  
          public IsProject(scrum.server.project.Project value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isProject(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - number
      // -----------------------------------------------------------
  
      private final Cache<Integer,Set<Risk>> risksByNumberCache = new Cache<Integer,Set<Risk>>(
              new Cache.Factory<Integer,Set<Risk>>() {
                  public Set<Risk> create(Integer number) {
                      return getEntities(new IsNumber(number));
                  }
              });
  
      public final Set<Risk> getRisksByNumber(int number) {
          return new HashSet<Risk>(risksByNumberCache.get(number));
      }
      private Set<Integer> numbersCache;
  
      public final Set<Integer> getNumbers() {
          if (numbersCache == null) {
              numbersCache = new HashSet<Integer>();
              for (Risk e : getEntities()) {
                  numbersCache.add(e.getNumber());
              }
          }
          return numbersCache;
      }
  
      private static class IsNumber implements Predicate<Risk> {
  
          private int value;
  
          public IsNumber(int value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isNumber(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - label
      // -----------------------------------------------------------
  
      private final Cache<java.lang.String,Set<Risk>> risksByLabelCache = new Cache<java.lang.String,Set<Risk>>(
              new Cache.Factory<java.lang.String,Set<Risk>>() {
                  public Set<Risk> create(java.lang.String label) {
                      return getEntities(new IsLabel(label));
                  }
              });
  
      public final Set<Risk> getRisksByLabel(java.lang.String label) {
          return new HashSet<Risk>(risksByLabelCache.get(label));
      }
      private Set<java.lang.String> labelsCache;
  
      public final Set<java.lang.String> getLabels() {
          if (labelsCache == null) {
              labelsCache = new HashSet<java.lang.String>();
              for (Risk e : getEntities()) {
                  if (e.isLabelSet()) labelsCache.add(e.getLabel());
              }
          }
          return labelsCache;
      }
  
      private static class IsLabel implements Predicate<Risk> {
  
          private java.lang.String value;
  
          public IsLabel(java.lang.String value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isLabel(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - description
      // -----------------------------------------------------------
  
      private final Cache<java.lang.String,Set<Risk>> risksByDescriptionCache = new Cache<java.lang.String,Set<Risk>>(
              new Cache.Factory<java.lang.String,Set<Risk>>() {
                  public Set<Risk> create(java.lang.String description) {
                      return getEntities(new IsDescription(description));
                  }
              });
  
      public final Set<Risk> getRisksByDescription(java.lang.String description) {
          return new HashSet<Risk>(risksByDescriptionCache.get(description));
      }
      private Set<java.lang.String> descriptionsCache;
  
      public final Set<java.lang.String> getDescriptions() {
          if (descriptionsCache == null) {
              descriptionsCache = new HashSet<java.lang.String>();
              for (Risk e : getEntities()) {
                  if (e.isDescriptionSet()) descriptionsCache.add(e.getDescription());
              }
          }
          return descriptionsCache;
      }
  
      private static class IsDescription implements Predicate<Risk> {
  
          private java.lang.String value;
  
          public IsDescription(java.lang.String value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isDescription(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - probabilityMitigation
      // -----------------------------------------------------------
  
      private final Cache<java.lang.String,Set<Risk>> risksByProbabilityMitigationCache = new Cache<java.lang.String,Set<Risk>>(
              new Cache.Factory<java.lang.String,Set<Risk>>() {
                  public Set<Risk> create(java.lang.String probabilityMitigation) {
                      return getEntities(new IsProbabilityMitigation(probabilityMitigation));
                  }
              });
  
      public final Set<Risk> getRisksByProbabilityMitigation(java.lang.String probabilityMitigation) {
          return new HashSet<Risk>(risksByProbabilityMitigationCache.get(probabilityMitigation));
      }
      private Set<java.lang.String> probabilityMitigationsCache;
  
      public final Set<java.lang.String> getProbabilityMitigations() {
          if (probabilityMitigationsCache == null) {
              probabilityMitigationsCache = new HashSet<java.lang.String>();
              for (Risk e : getEntities()) {
                  if (e.isProbabilityMitigationSet()) probabilityMitigationsCache.add(e.getProbabilityMitigation());
              }
          }
          return probabilityMitigationsCache;
      }
  
      private static class IsProbabilityMitigation implements Predicate<Risk> {
  
          private java.lang.String value;
  
          public IsProbabilityMitigation(java.lang.String value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isProbabilityMitigation(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - impactMitigation
      // -----------------------------------------------------------
  
      private final Cache<java.lang.String,Set<Risk>> risksByImpactMitigationCache = new Cache<java.lang.String,Set<Risk>>(
              new Cache.Factory<java.lang.String,Set<Risk>>() {
                  public Set<Risk> create(java.lang.String impactMitigation) {
                      return getEntities(new IsImpactMitigation(impactMitigation));
                  }
              });
  
      public final Set<Risk> getRisksByImpactMitigation(java.lang.String impactMitigation) {
          return new HashSet<Risk>(risksByImpactMitigationCache.get(impactMitigation));
      }
      private Set<java.lang.String> impactMitigationsCache;
  
      public final Set<java.lang.String> getImpactMitigations() {
          if (impactMitigationsCache == null) {
              impactMitigationsCache = new HashSet<java.lang.String>();
              for (Risk e : getEntities()) {
                  if (e.isImpactMitigationSet()) impactMitigationsCache.add(e.getImpactMitigation());
              }
          }
          return impactMitigationsCache;
      }
  
      private static class IsImpactMitigation implements Predicate<Risk> {
  
          private java.lang.String value;
  
          public IsImpactMitigation(java.lang.String value) {
              this.value = value;
          }
  
          public boolean test(Risk e) {
              return e.isImpactMitigation(value);
          }
  
      }
  
      // -----------------------------------------------------------
      // - probability
      // -----------------------------------------------------------
  
      private final Cache<Integer,Set<Risk>> risksByProbabilityCache = new Cache<Integer,Set<Risk>>(
              new Cache.Factory<Integer,Set<Risk>>() {
                  public Set<Risk> create(Integer probability) {
                      return getEntities(new IsProbability(probability));
                  }
              });
  
      public final Set<Risk> getRisksByProbability(int probability) {
          return new HashSet<Risk>(risksByProbabilityCache.get(probability));
      }
      private Set<Integer> probabilitysCache;
  
      public final Set<Integer> getProbabilitys() {
          if (probabilitysCache == null) {
              probabilitysCache = new HashSet<Integer>();
  