use of com.blazebit.persistence.parser.predicate.MemberOfPredicate in project blaze-persistence by Blazebit.
the class GeneralParserTest method testMemberOf.
@Test
public void testMemberOf() {
GeneralCaseExpression result = (GeneralCaseExpression) parse("CASE WHEN x.a MEMBER OF y.a THEN 0 ELSE 2 END");
Predicate condition = new MemberOfPredicate(path("x", "a"), path("y", "a"));
GeneralCaseExpression expectedExpr = new GeneralCaseExpression(Arrays.asList(new WhenClauseExpression(condition, _int("0"))), _int("2"));
assertEquals(expectedExpr, result);
}
use of com.blazebit.persistence.parser.predicate.MemberOfPredicate in project blaze-persistence by Blazebit.
the class GeneralParserTest method testCaseWhenSwitchTrue.
@Test
public void testCaseWhenSwitchTrue() {
GeneralCaseExpression result = (GeneralCaseExpression) parse("CASE WHEN localized[:locale] NOT MEMBER OF supportedLocales THEN true ELSE false END");
GeneralCaseExpression expected = new GeneralCaseExpression(Arrays.asList(new WhenClauseExpression(new MemberOfPredicate(path("localized[:locale]"), path("supportedLocales"), true), _boolean(true))), _boolean(false));
assertEquals(expected, result);
}
Aggregations