@SuppressWarnings("unchecked")
  public static Map<String, List<? extends SingularAttribute<?, ?>>> getPredicateMapping() {
    Map<String, List<? extends SingularAttribute<?, ?>>> mapping = new HashMap<>();

    mapping.put(AlertResourceProvider.ALERT_ID,
        Collections.singletonList(alertId));

    mapping.put(AlertResourceProvider.ALERT_LATEST_TIMESTAMP,
        Collections.singletonList(latestTimestamp));

    mapping.put(AlertResourceProvider.ALERT_ORIGINAL_TIMESTAMP,
        Collections.singletonList(originalTimestamp));

    mapping.put(AlertResourceProvider.ALERT_MAINTENANCE_STATE,
        Collections.singletonList(maintenanceState));

    mapping.put(AlertResourceProvider.ALERT_TEXT,
        Collections.singletonList(latestText));

    // AlertCurrentEntity.alertDefinition.definitionId = 1234
    mapping.put(AlertResourceProvider.ALERT_DEFINITION_ID,
        Arrays.asList(alertDefinition, AlertDefinitionEntity_.definitionId));

    // AlertCurrentEntity.alertDefinition.definitionName = foo
    mapping.put(AlertResourceProvider.ALERT_DEFINITION_NAME,
        Arrays.asList(alertDefinition, AlertDefinitionEntity_.definitionName));

    // AlertCurrentEntity.alertDefinition.serviceName = HDFS
    mapping.put(AlertResourceProvider.ALERT_SERVICE,
        Arrays.asList(alertDefinition, AlertDefinitionEntity_.serviceName));

    // AlertCurrentEntity.alertDefinition.componentName = DATANODE
    mapping.put(AlertResourceProvider.ALERT_COMPONENT,
        Arrays.asList(alertDefinition, AlertDefinitionEntity_.componentName));

    // AlertCurrentEntity.alertHistory.hostName = c6401.ambari.apache.org
    mapping.put(AlertResourceProvider.ALERT_HOST,
        Arrays.asList(alertHistory, AlertHistoryEntity_.hostName));

    // AlertCurrentEntity.alertHistory.state = OK
    mapping.put(AlertResourceProvider.ALERT_STATE,
        Arrays.asList(alertHistory, AlertHistoryEntity_.alertState));

    return mapping;
  }
Gets a mapping of between a resource provider property, like
{@link AlertResourceProvider#ALERT_ID} to a metamodel
{@link SingularAttribute}.
<p/>
This is used when converting an Ambari {@link Predicate} into a JPA
{@link jakarta.persistence.criteria.Predicate} and we need a type-safe
conversion between "category/property" and JPA field names.
<p/>
Multiple {@link SingularAttribute} instances can be chained together in
order to provide an {@code entity.subEntity.field} reference.

@return
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity_.java