@@ -67,48 +67,192 @@ public int getPage(){
6767 return sbxQueryBuilder .getPage ();
6868 }
6969
70- public SbxQuery addAND () {
71- sbxQueryBuilder .addAND ( );
72- return this ;
70+ public SbxQuery andWhereIsEqual ( String field , Object value ) throws JSONException {
71+ sbxQueryBuilder .andWhereIsEqual ( field , value );
72+ return this ;
7373 }
7474
75- public SbxQuery addOR () {
76- sbxQueryBuilder .addOR ( );
77- return this ;
75+ public SbxQuery andWhereIsNotNull ( String field ) throws JSONException {
76+ sbxQueryBuilder .andWhereIsNotNull ( field );
77+ return this ;
7878 }
7979
80- public SbxQuery whereIsEqual (String field , Object value ) throws JSONException {
81- sbxQueryBuilder .whereIsEqual (field ,value );
82- return this ;
80+ public SbxQuery andWhereGreaterThan (String field , Object value ) throws JSONException {
81+ sbxQueryBuilder .andWhereGreaterThan (field ,value );
82+ return this ;
8383 }
8484
85- public SbxQuery whereGreaterThan (String field , Object value ) throws JSONException {
86- sbxQueryBuilder .whereGreaterThan (field ,value );
87- return this ;
85+ public SbxQuery andWhereLessThan (String field , Object value ) throws JSONException {
86+ sbxQueryBuilder .andWhereLessThan (field ,value );
87+ return this ;
8888 }
8989
90- public SbxQuery whereLessThan (String field , Object value ) throws JSONException {
91- sbxQueryBuilder .whereLessThan (field ,value );
92- return this ;
90+ public SbxQuery andWhereGreaterOrEqualThan (String field , Object value ) throws JSONException {
91+ sbxQueryBuilder .andWhereGreaterOrEqualThan (field ,value );
92+ return this ;
9393 }
9494
95- public SbxQuery whereIsNotEqual (String field , Object value ) throws JSONException {
96- sbxQueryBuilder .whereIsNotEqual (field ,value );
97- return this ;
95+ public SbxQuery andWhereLessOrEqualThan (String field , Object value ) throws JSONException {
96+ sbxQueryBuilder .andWhereLessOrEqualThan (field ,value );
97+ return this ;
9898 }
9999
100- public SbxQuery whereLike (String field , Object value ) throws JSONException {
101- sbxQueryBuilder .whereLike (field ,value );
102- return this ;
100+ public SbxQuery andWhereIsNotEqual (String field , Object value ) throws JSONException {
101+ sbxQueryBuilder .andWhereIsNotEqual (field ,value );
102+ return this ;
103+ }
104+
105+ public SbxQuery andWhereLike (String field , Object value ) throws JSONException {
106+ sbxQueryBuilder .andWhereLike (field ,value );
107+ return this ;
108+ }
109+
110+ public SbxQuery andWhereIn (String field , Object value ) throws JSONException {
111+ sbxQueryBuilder .andWhereIn (field ,value );
112+ return this ;
113+ }
114+
115+
116+ public SbxQuery orWhereIsEqual (String field , Object value ) throws JSONException {
117+ sbxQueryBuilder .orWhereIsEqual (field ,value );
118+ return this ;
119+ }
120+
121+ public SbxQuery orWhereIsNotNull (String field ) throws JSONException {
122+ sbxQueryBuilder .orWhereIsNotNull (field );
123+ return this ;
124+ }
125+
126+ public SbxQuery orWhereGreaterThan (String field , Object value ) throws JSONException {
127+ sbxQueryBuilder .orWhereGreaterThan (field ,value );
128+ return this ;
129+ }
130+
131+ public SbxQuery orWhereLessThan (String field , Object value ) throws JSONException {
132+ sbxQueryBuilder .orWhereLessThan (field ,value );
133+ return this ;
134+ }
135+
136+ public SbxQuery orWhereGreaterOrEqualThan (String field , Object value ) throws JSONException {
137+ sbxQueryBuilder .orWhereGreaterOrEqualThan (field ,value );
138+ return this ;
139+ }
140+
141+ public SbxQuery orWhereLessOrEqualThan (String field , Object value ) throws JSONException {
142+ sbxQueryBuilder .orWhereLessOrEqualThan (field ,value );
143+ return this ;
144+ }
145+
146+ public SbxQuery orWhereIsNotEqual (String field , Object value ) throws JSONException {
147+ sbxQueryBuilder .orWhereIsNotEqual (field ,value );
148+ return this ;
149+ }
150+
151+ public SbxQuery orWhereLike (String field , Object value ) throws JSONException {
152+ sbxQueryBuilder .orWhereLike (field ,value );
153+ return this ;
154+ }
155+
156+ public SbxQuery orWhereIn (String field , Object value ) throws JSONException {
157+ sbxQueryBuilder .orWhereIn (field ,value );
158+ return this ;
159+ }
160+
161+ public SbxReferenceJoin orWhereReferenceJoinBetween (String field , String referenceField ) throws Exception {
162+ return new SbxReferenceJoin (this , sbxQueryBuilder .orWhereReferenceJoinBetween (field , referenceField ));
103163 }
104164
105- public SbxQueryBuilder whereIsNotNull (String field ) throws JSONException {
106- return sbxQueryBuilder .whereIsNotNull (field );
165+ public SbxReferenceJoin andWhereReferenceJoinBetween (String field , String referenceField ) throws Exception {
166+ return new SbxReferenceJoin (this , sbxQueryBuilder .andWhereReferenceJoinBetween (field , referenceField ));
167+ }
168+
169+ public class SbxReferenceJoin {
170+
171+ private SbxQueryBuilder .ReferenceJoin join ;
172+ private SbxQuery query ;
173+ SbxReferenceJoin (SbxQuery query , SbxQueryBuilder .ReferenceJoin join ) throws Exception {
174+ this .join = join ;
175+ this .query = query ;
176+ }
177+
178+ public SbxFilterJoin in (String referenceModel ) {
179+ return new SbxFilterJoin (query , join .in (referenceModel ));
180+ }
181+ }
182+
183+
184+ public class SbxFilterJoin {
185+
186+ private SbxQueryBuilder .FilterJoin filter ;
187+ private SbxQuery find ;
188+
189+
190+ SbxFilterJoin (SbxQuery find , SbxQueryBuilder .FilterJoin filter ) {
191+ this .filter = filter ;
192+ this .find = find ;
193+ }
194+
195+
196+ public SbxQuery filterWhereIsEqual (String field , Object value ) throws Exception {
197+ this .filter .filterWhereIsEqual ( field , value );
198+ return this .find ;
199+ }
200+
201+ public SbxQuery FilterWhereIsNotNull (String field ) throws Exception {
202+ this .filter .FilterWhereIsNotNull ( field );
203+ return this .find ;
204+ }
205+
206+ public SbxQuery FilterWhereIsNull (String field ) throws Exception {
207+ this .filter .FilterWhereIsNull ( field );
208+ return this .find ;
209+ }
210+
211+ public SbxQuery FilterWhereGreaterThan (String field , Object value ) throws Exception {
212+ this .filter .FilterWhereGreaterThan ( field , value );
213+ return this .find ;
214+ }
215+
216+ public SbxQuery FilterWhereLessThan (String field , Object value ) throws Exception {
217+ this .filter .FilterWhereLessThan ( field , value );
218+ return this .find ;
219+ }
220+
221+ public SbxQuery FilterWhereGreaterOrEqualThan (String field , Object value ) throws Exception {
222+ this .filter .FilterWhereGreaterOrEqualThan ( field , value );
223+ return this .find ;
224+ }
225+
226+ public SbxQuery FilterWhereLessOrEqualThan (String field , Object value ) throws Exception {
227+ this .filter .FilterWhereLessOrEqualThan ( field , value );
228+ return this .find ;
229+ }
230+
231+ public SbxQuery FilterWhereIsNotEqual (String field , Object value ) throws Exception {
232+ this .filter .FilterWhereIsNotEqual ( field , value );
233+ return this .find ;
234+ }
235+
236+ public SbxQuery FilterWhereLike (String field , Object value ) throws Exception {
237+ this .filter .FilterWhereLike ( field , value );
238+ return this .find ;
239+ }
240+
241+ public SbxQuery FilterWhereIn (String field , Object value ) throws Exception {
242+ this .filter .FilterWhereIn ( field , value );
243+ return this .find ;
244+ }
245+
246+ public SbxQuery FilterWhereNotIn (String field , Object value ) throws Exception {
247+ this .filter .FilterWhereNotIn ( field , value );
248+ return this .find ;
249+ }
250+
107251 }
108252
109253 public SbxQuery fetch (String propieties []) throws JSONException {
110254 sbxQueryBuilder .fetch (propieties );
111- return this ;
255+ return this ;
112256 }
113257
114258 public SbxQuery addGeoSort (double lat , double lon , String latName , String lonName ) throws JSONException {
0 commit comments