File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tests/objectbox-java-test/src/test/java/io/objectbox/query Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -118,4 +118,24 @@ public void and() {
118
118
assertEquals (2008 , entities .get (0 ).getSimpleInt ());
119
119
}
120
120
121
+ /**
122
+ * https://github.com/objectbox/objectbox-java/issues/834
123
+ */
124
+ @ Test
125
+ public void parameterAlias_combineWithOr () {
126
+ putTestEntitiesScalars ();
127
+
128
+ Query <TestEntity > query = box .query (
129
+ simpleInt .greater (0 ).alias ("greater" )
130
+ .or (simpleInt .less (0 ).alias ("less" ))
131
+ ).order (simpleInt ).build ();
132
+ List <TestEntity > results = query
133
+ .setParameter ("greater" , 2008 )
134
+ .setParameter ("less" , 2001 )
135
+ .find ();
136
+ assertEquals (2 , results .size ());
137
+ assertEquals (2000 , results .get (0 ).getSimpleInt ());
138
+ assertEquals (2009 , results .get (1 ).getSimpleInt ());
139
+ }
140
+
121
141
}
You can’t perform that action at this time.
0 commit comments