PRODSEC-5799 Upgrade mybatis (#879)

This commit is contained in:
Piotr Żurek
2022-01-18 10:33:46 +01:00
committed by GitHub
parent d8f086640a
commit d0dbef04f4
4 changed files with 58 additions and 15 deletions

View File

@@ -427,12 +427,12 @@
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
<version>3.5.9</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.5</version>
<version>2.0.6</version>
</dependency>
<!-- Activiti -->

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -28,6 +28,7 @@ package org.alfresco.ibatis;
import org.alfresco.metrics.db.DBMetricsReporter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.executor.BatchResult;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultContext;
@@ -246,6 +247,48 @@ public class SqlSessionMetricsWrapper implements SqlSession
}
}
@Override
public <T> Cursor<T> selectCursor(String statement)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public <T> Cursor<T> selectCursor(String statement, Object parameter)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement, parameter);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public <T> Cursor<T> selectCursor(String statement, Object parameter, RowBounds rowBounds)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement, parameter, rowBounds);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public int insert(String statement)
{

View File

@@ -49,12 +49,12 @@
<select id="select_Tenant" resultMap="result_Tenant">
select
tenant_domain as tenantDomain,
tenant_domain as tenant_domain,
version as version,
enabled as enabled,
tenant_name as tenantName,
content_root as contentRoot,
db_url as dbUrl
enabled enabled,
tenant_name tenant_name,
content_root content_root,
db_url db_url
from
alf_tenant
where
@@ -63,12 +63,12 @@
<select id="select_Tenants" parameterType="TenantQuery" resultMap="result_Tenant">
select
tenant_domain as tenantDomain,
version as version,
enabled as enabled,
tenant_name as tenantName,
content_root as contentRoot,
db_url as dbUrl
tenant_domain as tenant_domain,
version as version,
enabled as enabled,
tenant_name as tenant_name,
content_root as content_root,
db_url as db_url
from
alf_tenant
<where>

View File

@@ -15,7 +15,7 @@
</if>
</select>
<select id="select_ChildNodeIds_Limited" parameterType="Ids" resultMap="alfresco.node.result_ChildAssocIds" fetchSize="-2147483648">
<select id="select_ChildNodeIds_Limited" parameterType="ChildAssoc" resultMap="alfresco.node.result_ChildAssocIds" fetchSize="-2147483648">
<include refid="alfresco.node.select_ChildNodeIds_Limited_Snippet"/>
</select>