Package org.eclipse.edc.sql.translation
Class JsonArrayTranslator
java.lang.Object
org.eclipse.edc.sql.translation.JsonArrayTranslator
- All Implemented Interfaces:
FieldTranslator
This is a specialized translator, that targets object properties that are JSON array, for example
someObject.jsonArray,
and a criterion of "jsonArray contains foobar".
This is necessary, because with a conventional JsonFieldTranslator we would get (jsonArray -> 'jsonArray')::jsonb ?? ?,
because it always assumes one indirection from columnName to object name.
JsonArrayTranslator explicitly ignores this indirection.-
Field Summary
FieldsFields inherited from interface org.eclipse.edc.sql.translation.FieldTranslator
PREPARED_STATEMENT_PLACEHOLDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLeftOperand(List<org.eclipse.edc.util.reflection.PathItem> path, Class<?> rightOperandType) Get left operand for a SQL query given the canonical path name and the typetoWhereClause(List<org.eclipse.edc.util.reflection.PathItem> path, org.eclipse.edc.spi.query.Criterion criterion, SqlOperator operator) Translate theCriterioninto aWhereClause.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.edc.sql.translation.FieldTranslator
toParameters
-
Field Details
-
columnName
-
-
Constructor Details
-
JsonArrayTranslator
-
-
Method Details
-
getLeftOperand
public String getLeftOperand(List<org.eclipse.edc.util.reflection.PathItem> path, Class<?> rightOperandType) Description copied from interface:FieldTranslatorGet left operand for a SQL query given the canonical path name and the type- Specified by:
getLeftOperandin interfaceFieldTranslator- Parameters:
path- the path.- Returns:
- the left operand.
-
toWhereClause
public WhereClause toWhereClause(List<org.eclipse.edc.util.reflection.PathItem> path, org.eclipse.edc.spi.query.Criterion criterion, SqlOperator operator) Description copied from interface:FieldTranslatorTranslate theCriterioninto aWhereClause.- Specified by:
toWhereClausein interfaceFieldTranslator- Parameters:
path- the path.criterion- the criterion.operator- the sql operator.- Returns:
- the
WhereClause.
-