use of jakarta.nosql.Condition in project jnosql-diana-driver by eclipse.
the class Relations method load.
private static void load(ColumnCondition columnCondition, List<Relation> relations) {
Column column = columnCondition.getColumn();
Condition condition = columnCondition.getCondition();
switch(condition) {
case EQUALS:
relations.add(Relation.column(QueryUtils.getName(column)).isEqualTo(getTerm(column)));
return;
case GREATER_THAN:
relations.add(Relation.column(QueryUtils.getName(column)).isGreaterThan(getTerm(column)));
return;
case GREATER_EQUALS_THAN:
relations.add(Relation.column(QueryUtils.getName(column)).isGreaterThanOrEqualTo(getTerm(column)));
return;
case LESSER_THAN:
relations.add(Relation.column(QueryUtils.getName(column)).isLessThan(getTerm(column)));
return;
case LESSER_EQUALS_THAN:
relations.add(Relation.column(QueryUtils.getName(column)).isLessThanOrEqualTo(getTerm(column)));
return;
case IN:
relations.add(Relation.column(QueryUtils.getName(column)).in(getIinValue(column.getValue())));
return;
case LIKE:
relations.add(Relation.column(QueryUtils.getName(column)).like(getTerm(column)));
return;
case AND:
column.get(new TypeReference<List<ColumnCondition>>() {
}).forEach(cc -> load(cc, relations));
return;
case OR:
default:
throw new UnsupportedOperationException("The columnCondition " + condition + " is not supported in cassandra column driver");
}
}
Aggregations