@@ -57,7 +57,7 @@ One capability is that very expressive dynamic queries can be generated. Here's
57
57
try {
58
58
AnimalDataMapper mapper = sqlSession. getMapper(AnimalDataMapper . class);
59
59
60
- SelectStatement selectStatement = select(id, animalName, bodyWeight, brainWeight)
60
+ SelectStatementProvider selectStatement = select(id, animalName, bodyWeight, brainWeight)
61
61
.from(animalData)
62
62
.where(id, isIn(1 , 5 , 7 ))
63
63
.or(id, isIn(2 , 6 , 8 ), and(animalName, isLike(" %bat" )))
@@ -159,8 +159,8 @@ import org.apache.ibatis.annotations.DeleteProvider;
159
159
import org.apache.ibatis.annotations.Result ;
160
160
import org.apache.ibatis.annotations.Results ;
161
161
import org.apache.ibatis.annotations.SelectProvider ;
162
- import org.mybatis.dynamic.sql.delete.render.DeleteStatement ;
163
- import org.mybatis.dynamic.sql.select.render.SelectStatement ;
162
+ import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider ;
163
+ import org.mybatis.dynamic.sql.select.render.SelectStatementProvider ;
164
164
import org.mybatis.dynamic.sql.util.SqlProviderAdapter ;
165
165
166
166
public class SimpleTableAnnotatedMapper {
@@ -174,10 +174,10 @@ public class SimpleTableAnnotatedMapper {
174
174
@Result (column = " employed" , property = " employed" , jdbcType = JdbcType . VARCHAR , typeHandler = YesNoTypeHandler . class),
175
175
@Result (column = " occupation" , property = " occupation" , jdbcType = JdbcType . VARCHAR )
176
176
})
177
- List<SimpleTableRecord > selectMany (SelectStatement selectStatement );
177
+ List<SimpleTableRecord > selectMany (SelectStatementProvider selectStatement );
178
178
179
179
@DeleteProvider (type = SqlProviderAdapter . class, method = " delete" )
180
- int delete (DeleteStatement deleteStatement );
180
+ int delete (DeleteStatementProvider deleteStatement );
181
181
}
182
182
```
183
183
### Third - Create dynamic statements
@@ -188,7 +188,7 @@ All SQL construction methods can be accessed through expressive static methods i
188
188
For example, a very simple select statement can be defined like this:
189
189
190
190
``` java
191
- SelectStatement selectStatement = select(count())
191
+ SelectStatementProvider selectStatement = select(count())
192
192
.from(simpleTable)
193
193
.where(id, isEqualTo(3 ))
194
194
.build()
@@ -198,7 +198,7 @@ For example, a very simple select statement can be defined like this:
198
198
Or this (also note that you can give a table an alias):
199
199
200
200
``` java
201
- SelectStatement selectStatement = select(count())
201
+ SelectStatementProvider selectStatement = select(count())
202
202
.from(simpleTable, " a" )
203
203
.where(id, isNull())
204
204
.build()
@@ -207,7 +207,7 @@ Or this (also note that you can give a table an alias):
207
207
A delete statement looks like this:
208
208
209
209
``` java
210
- DeleteStatement deleteStatement = deleteFrom(simpleTable)
210
+ DeleteStatementProvider deleteStatement = deleteFrom(simpleTable)
211
211
.where(occupation, isNull())
212
212
.build()
213
213
.render(RenderingStrategy . MYBATIS3 );
@@ -216,7 +216,7 @@ A delete statement looks like this:
216
216
The "between" condition is also expressive:
217
217
218
218
``` java
219
- SelectStatement selectStatement = select(count())
219
+ SelectStatementProvider selectStatement = select(count())
220
220
.from(simpleTable)
221
221
.where(id, isBetween(1 ). and(4 ))
222
222
.build()
@@ -226,7 +226,7 @@ The "between" condition is also expressive:
226
226
More complex expressions can be built using the "and" and "or" conditions as follows:
227
227
228
228
``` java
229
- SelectStatement selectStatement = select(count())
229
+ SelectStatementProvider selectStatement = select(count())
230
230
.from(simpleTable)
231
231
.where(id, isGreaterThan(2 ))
232
232
.or(occupation, isNull(), and(id, isLessThan(6 )))
@@ -255,7 +255,7 @@ an example from `examples.simple.SimpleTableAnnotatedMapperTest`:
255
255
try {
256
256
SimpleTableXmlMapper mapper = session. getMapper(SimpleTableXmlMapper . class);
257
257
258
- SelectStatement selectStatement = select(id. as(" A_ID" ), firstName, lastName, birthDate, employed, occupation)
258
+ SelectStatementProvider selectStatement = select(id. as(" A_ID" ), firstName, lastName, birthDate, employed, occupation)
259
259
.from(simpleTable)
260
260
.where(id, isEqualTo(1 ))
261
261
.or(occupation, isNull())
0 commit comments