Class ProjectsQueryHelper

java.lang.Object
de.xima.fc.project.ProjectsQueryHelper

public class ProjectsQueryHelper extends Object
Query helper for projects.

Provides helper methods to create and manipulate project queries.

Since:
8.4.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • createCoalescedDisplayNameExpression

      public static javax.persistence.criteria.Expression<String> createCoalescedDisplayNameExpression(javax.persistence.criteria.CriteriaBuilder cb, javax.persistence.criteria.From<?,Projekt> projectFrom, Locale locale)
      Creates an expression to coalesce the display name of a project, handling localization fallbacks.

      The display name is coalesced in the following order:

      1. Given locale localization
      2. Default locale localization
      3. Project title

      The given locale localization is determined by the given locale, the default locale localization is determined by the project's default locale, and the project title is the default display name.

      Parameters:
      cb - Criteria builder to create the expression
      projectFrom - Project root to create the expression from
      locale - Locale to filter by
      Returns:
      Expression to coalesce the display name of a project
    • createCoalescedShortDescriptionExpression

      public static javax.persistence.criteria.Expression<String> createCoalescedShortDescriptionExpression(javax.persistence.criteria.CriteriaBuilder cb, javax.persistence.criteria.From<?,Projekt> projectRoot, Locale locale)
      Creates an expression to coalesce the short description of a project, handling localization fallbacks.

      The short description is coalesced in the following order:

      1. Given locale localization
      2. Default locale localization

      The given locale localization is determined by the given locale, and the default locale localization is determined by the project's default locale.

      Parameters:
      cb - Criteria builder to create the expression
      projectRoot - Project root to create the expression from
      locale - Locale to filter by
      Returns:
      Expression to coalesce the short description of a project