|
@@ -8,6 +8,7 @@ import org.hsweb.ezorm.render.support.simple.SimpleSQL;
|
|
|
import org.hsweb.web.core.authorize.ExpressionScopeBean;
|
|
|
import org.springframework.jdbc.datasource.DataSourceUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -34,6 +35,7 @@ public class SqlExecutorService extends AbstractJdbcSqlExecutor implements Expre
|
|
|
DataSourceUtils.releaseConnection(connection, dataSource);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(readOnly = true)
|
|
|
public <T> List<T> list(SQL sql, ObjectWrapper<T> wrapper) throws SQLException {
|
|
@@ -82,6 +84,37 @@ public class SqlExecutorService extends AbstractJdbcSqlExecutor implements Expre
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ public int update(String sql, Map<String, Object> param) throws SQLException {
|
|
|
+ return super.update(new SimpleSQL(sql, param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public int update(String sql) throws SQLException {
|
|
|
+ return super.update(new SimpleSQL(sql));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public int delete(String sql, Map<String, Object> param) throws SQLException {
|
|
|
+ return super.delete(new SimpleSQL(sql, param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public int delete(String sql) throws SQLException {
|
|
|
+ return super.delete(new SimpleSQL(sql));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
|
+ public void exec(String sql) throws SQLException {
|
|
|
+ super.exec(new SimpleSQL(sql));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
|
+ public void exec(SQL sql) throws SQLException {
|
|
|
+ super.exec(sql);
|
|
|
+ }
|
|
|
+
|
|
|
public SQL create(String sql) {
|
|
|
return new SimpleSQL(sql);
|
|
|
}
|