Skip to content

Commit 667a078

Browse files
committed
Added new flushStatements method to SqlSessionTemplate.
Fixed compiler warnings for new generic TypeHanders.
1 parent 7fcacfb commit 667a078

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class SqlSessionFactoryBean implements FactoryBean<SqlSessionFactory>, In
8484

8585
private Interceptor[] plugins;
8686

87-
private TypeHandler[] typeHandlers;
87+
private TypeHandler<?>[] typeHandlers;
8888

8989
private String typeHandlersPackage;
9090

@@ -135,7 +135,7 @@ public void setTypeHandlersPackage(String typeHandlersPackage) {
135135
*
136136
* @param typeHandlers Type handler list
137137
*/
138-
public void setTypeHandlers(TypeHandler[] typeHandlers) {
138+
public void setTypeHandlers(TypeHandler<?>[] typeHandlers) {
139139
this.typeHandlers = typeHandlers;
140140
}
141141

@@ -334,7 +334,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
334334
}
335335

336336
if (!ObjectUtils.isEmpty(this.typeHandlers)) {
337-
for (TypeHandler typeHandler : this.typeHandlers) {
337+
for (TypeHandler<?> typeHandler : this.typeHandlers) {
338338
configuration.getTypeHandlerRegistry().register(typeHandler);
339339
if (this.logger.isDebugEnabled()) {
340340
this.logger.debug("Registered type handler: '" + typeHandler + "'");

src/main/java/org/mybatis/spring/SqlSessionTemplate.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Map;
2424

2525
import org.apache.ibatis.exceptions.PersistenceException;
26+
import org.apache.ibatis.executor.BatchResult;
2627
import org.apache.ibatis.reflection.ExceptionUtil;
2728
import org.apache.ibatis.session.Configuration;
2829
import org.apache.ibatis.session.ExecutorType;
@@ -310,6 +311,7 @@ public void clearCache() {
310311

311312
/**
312313
* {@inheritDoc}
314+
*
313315
*/
314316
public Configuration getConfiguration() {
315317
return this.sqlSessionFactory.getConfiguration();
@@ -322,6 +324,16 @@ public Connection getConnection() {
322324
return this.sqlSessionProxy.getConnection();
323325
}
324326

327+
/**
328+
* {@inheritDoc}
329+
*
330+
* @since 1.0.2
331+
*
332+
*/
333+
public List<BatchResult> flushStatements() {
334+
return this.sqlSessionProxy.flushStatements();
335+
}
336+
325337
/**
326338
* Proxy needed to route MyBatis method calls to the proper SqlSession got
327339
* from String's Transaction Manager

0 commit comments

Comments
 (0)