Package io.github.perplexhub.rsql.jsonb
Class JsonbSupport
java.lang.Object
io.github.perplexhub.rsql.jsonb.JsonbSupport
Support for jsonb expression.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static ResolvedExpression
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.
-
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 pathselector
- 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 propertyclassMetadata
- the class metadata- Returns:
- true if the attribute is a jsonb attribute
-