Class JsonbSupport

java.lang.Object
io.github.perplexhub.rsql.jsonb.JsonbSupport

public class JsonbSupport extends Object
Support for jsonb expression.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isJsonType(jakarta.persistence.metamodel.Attribute<?,?> attribute)
    Returns whether the given attribute is a jsonb attribute.
    static boolean
    isJsonType(String mappedProperty, jakarta.persistence.metamodel.ManagedType<?> classMetadata)
    Returns whether the given property is a jsonb attribute.
    jsonbPathExistsExpression(jakarta.persistence.criteria.CriteriaBuilder builder, cz.jirutka.rsql.parser.ast.ComparisonNode node, jakarta.persistence.criteria.Path<?> attrPath)
     
    static String
    jsonPathOfSelector(jakarta.persistence.metamodel.Attribute<?,?> attrPath, String selector)
    Returns the jsonb path for the given attribute path and selector.
    It extracts the jsonb part of the selector that can contains entity references before the jsonb path.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DATE_TIME_SUPPORT

      public static boolean DATE_TIME_SUPPORT
  • Constructor Details

    • JsonbSupport

      public JsonbSupport()
  • Method Details

    • jsonPathOfSelector

      public static String jsonPathOfSelector(jakarta.persistence.metamodel.Attribute<?,?> attrPath, String selector)
      Returns the jsonb path for the given attribute path and selector.
      It extracts the jsonb part of the selector that can contains entity references before the jsonb path.
      Parameters:
      attrPath - the attribute path
      selector - the selector
      Returns:
      the jsonb path
    • jsonbPathExistsExpression

      public static ResolvedExpression jsonbPathExistsExpression(jakarta.persistence.criteria.CriteriaBuilder builder, cz.jirutka.rsql.parser.ast.ComparisonNode node, jakarta.persistence.criteria.Path<?> attrPath)
    • isJsonType

      public static boolean isJsonType(jakarta.persistence.metamodel.Attribute<?,?> attribute)
      Returns whether the given attribute is a jsonb attribute.
      Parameters:
      attribute - the attribute
      Returns:
      true if the attribute is a jsonb attribute
    • isJsonType

      public static boolean isJsonType(String mappedProperty, jakarta.persistence.metamodel.ManagedType<?> classMetadata)
      Returns whether the given property is a jsonb attribute.
      Parameters:
      mappedProperty - the mapped property
      classMetadata - the class metadata
      Returns:
      true if the attribute is a jsonb attribute