mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged DEV/SWIFT to HEAD
25490: ALF-5260 - MyBatis: AVM (-> MySQL) - includes SerializableTypeHandler - also, for consistency, remove SqlSessionDaoSupport from Activtities (r25466) - TODO: test EliminateDuplicates patch - TODO: inserts for non-MySQL dbs 25504: ALF-5260 - MyBatis: part III - AppliedPatch, Content/MimeType/Encoding, Locale, Locks, QName, Usage - also minor updates to AVM & Activities (for consistency) 25517: ALF-5260 - MyBatis: part IV - DAOs - Patch, Permissions/ACLs, PropVal, SOLR - NOTE: includes fixup for SOLRDAOTest - also return nodeRef - TODO: batching (for ContentUrl patch) 25541: ALF-5260 - MyBatis: add missing file (r25517) 25556: ALF-5260 - MyBatis: V - PostgreSQL support (for migrated DAOs - does not yet include Audit + Node) 25576: ALF-5260 - MyBatis: VI - Audit & Control DAOs (MySQL + PostgreSQL) - also replaced SqlExecutor.NO_MAXIMUM_RESULTS with RowBounds.NO_ROW_LIMIT 25589: ALF-5260 - MyBatis: part VII - Node DAO (MySQL + PostgreSQL) 25612: ALF-5260 - MyBatis: part VIII - Oracle / DB2 / SQL Server - sanity checked only (bootstrap -> RepositoryStartupTest, DomainTestSuite, ModelTestSuite) - also remove remaining references to iBatis (and jar) Note: - Currently LockDAOTest is failing on an update - Fixed up DAo code changes from V3.4 - expect some to have been missed git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,10 +20,12 @@
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="controlDAO.org.hibernate.dialect.Dialect"
|
||||
class="org.alfresco.repo.domain.control.ibatis.ControlDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="controlDAO.org.hibernate.dialect.PostgreSQLDialect"
|
||||
class="org.alfresco.repo.domain.control.ibatis.ControlDAOImpl$PostgreSQL"
|
||||
parent="controlDAO.org.hibernate.dialect.Dialect">
|
||||
@@ -42,24 +44,24 @@
|
||||
</bean>
|
||||
|
||||
<bean id="patchDAO" class="org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="localeDAO" ref="localeDAO"/>
|
||||
<property name="contentDataDAO" ref="contentDataDAO"/>
|
||||
</bean>
|
||||
|
||||
<bean id="appliedPatchDAO" class="org.alfresco.repo.domain.patch.ibatis.AppliedPatchDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="qnameDAO" class="org.alfresco.repo.domain.qname.ibatis.QNameDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="namespaceCache" ref="immutableEntityCache"/>
|
||||
<property name="qnameCache" ref="immutableEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="nodeDAO" class="org.alfresco.repo.domain.node.ibatis.NodeDAOImpl" init-method="init">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="enableTimestampPropagation" value="${system.enableTimestampPropagation}" />
|
||||
<property name="transactionService" ref="transactionService" />
|
||||
<property name="dictionaryService" ref="dictionaryService"/>
|
||||
@@ -79,27 +81,27 @@
|
||||
</bean>
|
||||
|
||||
<bean id="lockDAO" class="org.alfresco.repo.domain.locks.ibatis.LockDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="locksSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="locksSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mimetypeDAO" class="org.alfresco.repo.domain.mimetype.ibatis.MimetypeDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="contentSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="contentSqlSessionTemplate"/>
|
||||
<property name="mimetypeEntityCache" ref="immutableEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="encodingDAO" class="org.alfresco.repo.domain.encoding.ibatis.EncodingDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="contentSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="contentSqlSessionTemplate"/>
|
||||
<property name="encodingEntityCache" ref="immutableEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="localeDAO" class="org.alfresco.repo.domain.locale.ibatis.LocaleDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="localeEntityCache" ref="immutableEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="contentDataDAO" class="org.alfresco.repo.domain.contentdata.ibatis.ContentDataDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="contentSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="contentSqlSessionTemplate"/>
|
||||
<property name="contentDataCache" ref="contentDataCache"/>
|
||||
<property name="controlDAO" ref="controlDAO"/>
|
||||
<property name="mimetypeDAO" ref="mimetypeDAO"/>
|
||||
@@ -109,7 +111,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="propertyValueDAO" class="org.alfresco.repo.domain.propval.ibatis.PropertyValueDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="propertyValueSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="propertyValueSqlSessionTemplate"/>
|
||||
<property name="converter">
|
||||
<bean class="org.alfresco.repo.domain.propval.DefaultPropertyTypeConverter"/>
|
||||
</property>
|
||||
@@ -126,7 +128,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="auditDAO" class="org.alfresco.repo.domain.audit.ibatis.AuditDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="auditSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="auditSqlSessionTemplate"/>
|
||||
<property name="contentService" ref="contentService"/>
|
||||
<property name="contentDataDAO" ref="contentDataDAO"/>
|
||||
<property name="propertyValueDAO" ref="propertyValueDAO"/>
|
||||
@@ -135,14 +137,14 @@
|
||||
<!-- AVM -->
|
||||
|
||||
<bean id="newAvmStoreDAO" class="org.alfresco.repo.domain.avm.ibatis.AVMStoreDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="avmSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="avmStoreCache" ref="avmStoreCache"/>
|
||||
<property name="avmStorePropertyCache" ref="avmEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newAvmNodeDAO" class="org.alfresco.repo.domain.avm.ibatis.AVMNodeDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="avmSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="avmNodeCache" ref="avmNodeCache"/>
|
||||
<property name="avmNodePropertyCache" ref="avmEntityCache"/>
|
||||
@@ -150,18 +152,18 @@
|
||||
</bean>
|
||||
|
||||
<bean id="newAvmNodeLinksDAO" class="org.alfresco.repo.domain.avm.ibatis.AVMNodeLinksDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="avmSqlSessionTemplate"/>
|
||||
<property name="avmChildEntryCache" ref="avmEntityCache"/>
|
||||
<property name="avmHistoryLinkCache" ref="avmEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newAvmVersionRootDAO" class="org.alfresco.repo.domain.avm.ibatis.AVMVersionRootDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="avmSqlSessionTemplate"/>
|
||||
<property name="versionRootEntityCache" ref="avmVersionRootEntityCache"/>
|
||||
</bean>
|
||||
|
||||
<bean id="avmLockDAO" class="org.alfresco.repo.domain.avm.ibatis.AVMLockDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="avmSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="avmSqlSessionTemplate"/>
|
||||
<property name="propertyValueDAO" ref="propertyValueDAO"/>
|
||||
</bean>
|
||||
|
||||
@@ -226,7 +228,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="aclCrudDAO" class="org.alfresco.repo.domain.permissions.ibatis.AclCrudDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="aclEntityCache" ref="aclEntityCache"/>
|
||||
<property name="authorityEntityCache" ref="authorityEntityCache"/>
|
||||
@@ -243,18 +245,18 @@
|
||||
</bean>
|
||||
|
||||
<bean id="usageDAO" class="org.alfresco.repo.domain.usage.ibatis.UsageDAOImpl">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="nodeDAO" ref="nodeDAO"/>
|
||||
</bean>
|
||||
|
||||
<bean id="cannedQueryDAO" class="org.alfresco.repo.domain.query.ibatis.CannedQueryDAOImpl" init-method="init">
|
||||
<property name="sqlMapClientTemplate" ref="repoSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="repoSqlSessionTemplate"/>
|
||||
<property name="controlDAO" ref="controlDAO"/>
|
||||
</bean>
|
||||
|
||||
<bean id="solrDAO" class="org.alfresco.repo.domain.solr.ibatis.SOLRDAOImpl" init-method="init">
|
||||
<property name="sqlMapClientTemplate" ref="solrSqlMapClientTemplate"/>
|
||||
<property name="sqlSessionTemplate" ref="solrSqlSessionTemplate"/>
|
||||
<property name="qNameDAO" ref="qnameDAO"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -18,33 +18,4 @@
|
||||
|
||||
<typeHandler javaType="java.io.Serializable" jdbcType="BLOB" callback="org.alfresco.ibatis.SerializableTypeHandlerCallback"/>
|
||||
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/appliedpatch-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/patch-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/qname-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/locale-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/locale-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/node-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/node-update-acl-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/node-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/locks-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/locks-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/content-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/content-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/propval-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/propval-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/audit-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/audit-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/avm-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/avm-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/permissions-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/permissions-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/usage-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/usage-insert-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/solr-common-SqlMap.xml"/>
|
||||
|
||||
<!-- Canned queries -->
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/query-test-common-SqlMap.xml"/>
|
||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/query-usages-common-SqlMap.xml"/>
|
||||
|
||||
</sqlMapConfig>
|
@@ -57,34 +57,41 @@
|
||||
<constructor-arg index="0" ref="activitiesSqlSessionFactory"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- iBatis config for Alfresco (using common datasource) -->
|
||||
<bean id="alfrescoSqlMapClient" class="org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean">
|
||||
<!-- MyBatis config for Alfresco (using common datasource) -->
|
||||
<bean id="repoSqlSessionFactory" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean">
|
||||
<property name="resourceLoader" ref="dialectResourceLoader"/>
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="resourceLoader" ref="dialectResourceLoader" />
|
||||
<property name="configLocation">
|
||||
<value>classpath:alfresco/ibatis/alfresco-SqlMapConfig.xml</value>
|
||||
<value>classpath:alfresco/ibatis/repo-SqlMapConfig.xml</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="repoSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="avmSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="locksSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="repoSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="contentSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="contentSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="propertyValueSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="locksSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="auditSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="propertyValueSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="avmSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="solrSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
<bean id="solrSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
|
||||
<property name="sqlMapClient" ref="alfrescoSqlMapClient"/>
|
||||
|
||||
<bean id="auditSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="repoSqlSessionFactory"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -1,29 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.appliedpatch">
|
||||
<mapper namespace="alfresco.appliedpatch">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="AppliedPatch" type="org.alfresco.repo.domain.patch.AppliedPatchEntity"/>
|
||||
<!--NOTE: MyBatis #224 - eg. Oracle -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_AppliedPatch" class="AppliedPatch">
|
||||
<resultMap id="result_AppliedPatch" type="AppliedPatch">
|
||||
<result property="id" column="id" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="description" column="description" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="fixesFromSchema" column="fixes_from_schema" jdbcType="INT" javaType="int" />
|
||||
<result property="fixesToSchema" column="fixes_to_schema" jdbcType="INT" javaType="int" />
|
||||
<result property="targetSchema" column="target_schema" jdbcType="INT" javaType="int" />
|
||||
<result property="appliedToSchema" column="applied_to_schema" jdbcType="INT" javaType="int" />
|
||||
<result property="appliedOnDate" column="applied_on_date" jdbcType="DATETIME" javaType="date" />
|
||||
<result property="fixesFromSchema" column="fixes_from_schema" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="fixesToSchema" column="fixes_to_schema" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="targetSchema" column="target_schema" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="appliedToSchema" column="applied_to_schema" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="appliedOnDate" column="applied_on_date" jdbcType="DATE" javaType="date" />
|
||||
<result property="appliedToServer" column="applied_to_server" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="wasExecuted" column="was_executed" jdbcType="BOOLEAN" javaType="boolean"/>
|
||||
<result property="succeeded" column="succeeded" jdbcType="BOOLEAN" javaType="boolean"/>
|
||||
@@ -34,7 +28,8 @@
|
||||
<!-- SQL Snippets / Inserts -->
|
||||
<!-- -->
|
||||
|
||||
<insert id="insert_AppliedPatch" parameterClass="AppliedPatch">
|
||||
<!-- MyBatis #224 -->
|
||||
<insert id="insert_AppliedPatch" parameterType="AppliedPatch">
|
||||
insert into alf_applied_patch
|
||||
(
|
||||
id, description,
|
||||
@@ -44,10 +39,10 @@
|
||||
)
|
||||
values
|
||||
(
|
||||
#id#, #description#,
|
||||
#fixesFromSchema#, #fixesToSchema#, #targetSchema#,
|
||||
#appliedToSchema#, #appliedOnDate#, #appliedToServer#,
|
||||
#wasExecuted#, #succeeded#, #report#
|
||||
#{id}, #{description,jdbcType=VARCHAR},
|
||||
#{fixesFromSchema,jdbcType=INTEGER}, #{fixesToSchema,jdbcType=INTEGER}, #{targetSchema,jdbcType=INTEGER},
|
||||
#{appliedToSchema,jdbcType=INTEGER}, #{appliedOnDate,jdbcType=DATE}, #{appliedToServer,jdbcType=VARCHAR},
|
||||
#{wasExecuted,jdbcType=BOOLEAN}, #{succeeded,jdbcType=BOOLEAN}, #{report,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -55,28 +50,29 @@
|
||||
<!-- Updates -->
|
||||
<!-- -->
|
||||
|
||||
<insert id="update_AppliedPatch" parameterClass="AppliedPatch">
|
||||
<!-- MyBatis #224 -->
|
||||
<insert id="update_AppliedPatch" parameterType="AppliedPatch">
|
||||
update alf_applied_patch
|
||||
set
|
||||
description = #description#,
|
||||
fixes_from_schema = #fixesFromSchema#,
|
||||
fixes_to_schema = #fixesToSchema#,
|
||||
target_schema = #targetSchema#,
|
||||
applied_to_schema = #appliedToSchema#,
|
||||
applied_on_date = #appliedOnDate#,
|
||||
applied_to_server = #appliedToServer#,
|
||||
was_executed = #wasExecuted#,
|
||||
succeeded = #succeeded#,
|
||||
report = #report#
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
fixes_from_schema = #{fixesFromSchema,jdbcType=INTEGER},
|
||||
fixes_to_schema = #{fixesToSchema,jdbcType=INTEGER},
|
||||
target_schema = #{targetSchema,jdbcType=INTEGER},
|
||||
applied_to_schema = #{appliedToSchema,jdbcType=INTEGER},
|
||||
applied_on_date = #{appliedOnDate,jdbcType=DATE},
|
||||
applied_to_server = #{appliedToServer,jdbcType=VARCHAR},
|
||||
was_executed = #{wasExecuted,jdbcType=BOOLEAN},
|
||||
succeeded = #{succeeded,jdbcType=BOOLEAN},
|
||||
report = #{report,jdbcType=VARCHAR}
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</insert>
|
||||
|
||||
<!-- -->
|
||||
<!-- Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_AppliedPatchById" parameterClass="AppliedPatch" resultMap="result_AppliedPatch">
|
||||
<select id="select_AppliedPatchById" parameterType="AppliedPatch" resultMap="result_AppliedPatch">
|
||||
select
|
||||
id, description,
|
||||
fixes_from_schema, fixes_to_schema, target_schema,
|
||||
@@ -85,7 +81,7 @@
|
||||
from
|
||||
alf_applied_patch
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="select_AllAppliedPatches" resultMap="result_AppliedPatch">
|
||||
@@ -100,4 +96,4 @@
|
||||
target_schema
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,46 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.audit">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="AuditModel" type="org.alfresco.repo.domain.audit.AuditModelEntity"/>
|
||||
<typeAlias alias="AuditApplication" type="org.alfresco.repo.domain.audit.AuditApplicationEntity"/>
|
||||
<typeAlias alias="AuditEntry" type="org.alfresco.repo.domain.audit.AuditEntryEntity"/>
|
||||
<typeAlias alias="AuditDeleteParameters" type="org.alfresco.repo.domain.audit.AuditDeleteParameters"/>
|
||||
<typeAlias alias="AuditQueryParameters" type="org.alfresco.repo.domain.audit.AuditQueryParameters"/>
|
||||
<typeAlias alias="AuditQueryResult" type="org.alfresco.repo.domain.audit.AuditQueryResult"/>
|
||||
<mapper namespace="alfresco.audit">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_AuditModel" class="AuditModel">
|
||||
<resultMap id="result_AuditModel" type="AuditModel">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="contentDataId" column="content_data_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="contentCrc" column="content_crc" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_AuditApplication" class="AuditApplication">
|
||||
<resultMap id="result_AuditApplication" type="AuditApplication">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
<result property="applicationNameId" column="app_name_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="auditModelId" column="audit_model_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="disabledPathsId" column="disabled_paths_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_AuditEntry" class="AuditEntry">
|
||||
<resultMap id="result_AuditEntry" type="AuditEntry">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="auditApplicationId" column="audit_app_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="auditUserId" column="audit_user_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="auditTime" column="audit_time" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="auditValuesId" column="audit_values_id" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_AuditQueryNoValues" class="AuditQueryResult">
|
||||
<resultMap id="result_AuditQueryNoValues" type="AuditQueryResult">
|
||||
<result property="auditAppNameId" column="audit_app_name_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="auditEntryId" column="audit_entry_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="auditUserId" column="audit_user_id" jdbcType="BIGINT" javaType="long"/>
|
||||
@@ -49,15 +36,15 @@
|
||||
</resultMap>
|
||||
<resultMap id="result_AuditQueryAllValues"
|
||||
extends="alfresco.audit.result_AuditQueryNoValues"
|
||||
class="AuditQueryResult">
|
||||
<result property="auditValueRows" resultMap="alfresco.propval.result_PropertyIdSearchRow"/>
|
||||
type="AuditQueryResult">
|
||||
<association property="auditValueRows" resultMap="alfresco.propval.result_PropertyIdSearchRow"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- -->
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
@@ -67,17 +54,32 @@
|
||||
|
||||
<sql id="insert_AuditModel_AutoIncrement">
|
||||
insert into alf_audit_model (content_data_id, content_crc)
|
||||
values (#contentDataId#, #contentCrc#)
|
||||
values (#{contentDataId}, #{contentCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuditModel_Sequence">
|
||||
insert into alf_audit_model (id, content_data_id, content_crc)
|
||||
values (#{id}, #{contentDataId}, #{contentCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuditApplication_AutoIncrement">
|
||||
insert into alf_audit_app (version, app_name_id, audit_model_id, disabled_paths_id)
|
||||
values (#version#, #applicationNameId#, #auditModelId#, #disabledPathsId#)
|
||||
values (#{version}, #{applicationNameId}, #{auditModelId}, #{disabledPathsId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuditApplication_Sequence">
|
||||
insert into alf_audit_app (id, version, app_name_id, audit_model_id, disabled_paths_id)
|
||||
values (#{id}, #{version}, #{applicationNameId}, #{auditModelId}, #{disabledPathsId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuditEntry_AutoIncrement">
|
||||
insert into alf_audit_entry (audit_app_id, audit_user_id, audit_time, audit_values_id)
|
||||
values (#auditApplicationId#, #auditUserId#, #auditTime#, #auditValuesId#)
|
||||
values (#{auditApplicationId}, #{auditUserId}, #{auditTime}, #{auditValuesId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuditEntry_Sequence">
|
||||
insert into alf_audit_entry (id, audit_app_id, audit_user_id, audit_time, audit_values_id)
|
||||
values (#{id}, #{auditApplicationId}, #{auditUserId}, #{auditTime}, #{auditValuesId})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
@@ -85,13 +87,13 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get the audit model by the CRC value -->
|
||||
<select id="select_AuditModelByCrc" parameterClass="AuditModel" resultMap="result_AuditModel">
|
||||
<select id="select_AuditModelByCrc" parameterType="AuditModel" resultMap="result_AuditModel">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_audit_model
|
||||
where
|
||||
content_crc = #contentCrc#
|
||||
content_crc = #{contentCrc}
|
||||
</select>
|
||||
|
||||
<!-- Get the audit application by ID -->
|
||||
@@ -115,83 +117,90 @@
|
||||
</select>
|
||||
|
||||
<!-- Optimistic update of the audit application -->
|
||||
<update id="update_AuditApplication" parameterClass="AuditApplication">
|
||||
<update id="update_AuditApplication" parameterType="AuditApplication">
|
||||
update
|
||||
alf_audit_app
|
||||
set
|
||||
version = #version#,
|
||||
app_name_id = #applicationNameId#,
|
||||
audit_model_id = #auditModelId#,
|
||||
disabled_paths_id = #disabledPathsId#
|
||||
version = #{version},
|
||||
app_name_id = #{applicationNameId},
|
||||
audit_model_id = #{auditModelId},
|
||||
disabled_paths_id = #{disabledPathsId}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- TODO: This has to be replaced with two deletes; one for the property links and another for the entries -->
|
||||
<delete id="delete_AuditEntries" parameterClass="AuditDeleteParameters">
|
||||
<delete id="delete_AuditEntries" parameterType="AuditDeleteParameters">
|
||||
delete
|
||||
from
|
||||
alf_audit_entry
|
||||
<dynamic prepend="where">
|
||||
<isNotNull property="auditFromTime" prepend="and">
|
||||
audit_app_id = #auditApplicationId#
|
||||
</isNotNull>
|
||||
<isNotNull property="auditFromTime" prepend="and">
|
||||
<![CDATA[audit_time >= #auditFromTime#]]>
|
||||
</isNotNull>
|
||||
<isNotNull property="auditFromTime" prepend="and">
|
||||
<![CDATA[audit_time < #auditToTime#]]>
|
||||
</isNotNull>
|
||||
<isNotNull property="auditEntryIds" prepend="and">
|
||||
id in <iterate property="auditEntryIds" open="(" close=")" conjunction=", ">#auditEntryIds[]#</iterate>
|
||||
</isNotNull>
|
||||
</dynamic>
|
||||
<where>
|
||||
<if test="auditFromTime != null">
|
||||
audit_app_id = #{auditApplicationId}
|
||||
</if>
|
||||
<if test="auditFromTime != null">
|
||||
and audit_app_id = #{auditApplicationId}
|
||||
</if>
|
||||
<if test="auditFromTime != null">
|
||||
<![CDATA[and audit_time >= #{auditFromTime}]]>
|
||||
</if>
|
||||
<if test="auditFromTime != null">
|
||||
<![CDATA[and audit_time < #{auditToTime}]]>
|
||||
</if>
|
||||
<if test="auditEntryIds != null">
|
||||
and id in
|
||||
<foreach item="item" index="index" collection="auditEntryIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<sql id="select_AuditEntriesWhereSnippet">
|
||||
<dynamic prepend="where">
|
||||
<isNotNull prepend="and" property="auditAppNameId">
|
||||
app.app_name_id = #auditAppNameId#
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="auditUserId">
|
||||
entry.audit_user_id = #auditUserId#
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="auditFromId">
|
||||
<![CDATA[entry.id >= #auditFromId#]]>
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="auditToId">
|
||||
<![CDATA[entry.id < #auditToId#]]>
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="auditFromTime">
|
||||
<![CDATA[entry.audit_time >= #auditFromTime#]]>
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="auditToTime">
|
||||
<![CDATA[entry.audit_time < #auditToTime#]]>
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="searchKeyId">
|
||||
sp_pl.key_prop_id = #searchKeyId#
|
||||
</isNotNull>
|
||||
<isNotNull prepend="and" property="searchValueId">
|
||||
sp_pl.value_prop_id = #searchValueId#
|
||||
</isNotNull>
|
||||
</dynamic>
|
||||
<where>
|
||||
<if test="auditAppNameId != null">
|
||||
app.app_name_id = #{auditAppNameId}
|
||||
</if>
|
||||
<if test="auditUserId != null">
|
||||
and entry.audit_user_id = #{auditUserId}
|
||||
</if>
|
||||
<if test="auditFromId != null">
|
||||
<![CDATA[and entry.id >= #{auditFromId}]]>
|
||||
</if>
|
||||
<if test="auditToId != null">
|
||||
<![CDATA[and entry.id < #{auditToId}]]>
|
||||
</if>
|
||||
<if test="auditFromTime != null">
|
||||
<![CDATA[and entry.audit_time >= #{auditFromTime}]]>
|
||||
</if>
|
||||
<if test="auditToTime != null">
|
||||
<![CDATA[and entry.audit_time < #{auditToTime}]]>
|
||||
</if>
|
||||
<if test="searchKeyId != null">
|
||||
and sp_pl.key_prop_id = #{searchKeyId}
|
||||
</if>
|
||||
<if test="searchValueId != null">
|
||||
and sp_pl.value_prop_id = #{searchValueId}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<sql id="select_AuditEntriesOrderBySnippet">
|
||||
<isEqual property="forward" compareProperty="forwardTrue">
|
||||
<if test="forward == forwardTrue">
|
||||
order by
|
||||
entry.id asc
|
||||
</isEqual>
|
||||
<isNotEqual property="forward" compareProperty="forwardTrue">
|
||||
</if>
|
||||
<if test="forward != forwardTrue">
|
||||
order by
|
||||
entry.id desc
|
||||
</isNotEqual>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- Get audit entries -->
|
||||
<select id="select_AuditEntriesWithValues" parameterClass="AuditQueryParameters" resultMap="result_AuditQueryAllValues">
|
||||
<select id="select_AuditEntriesWithValues" parameterType="AuditQueryParameters" resultMap="result_AuditQueryAllValues">
|
||||
select
|
||||
app.app_name_id as audit_app_name_id,
|
||||
entry.id as audit_entry_id,
|
||||
@@ -214,9 +223,9 @@
|
||||
alf_audit_app app
|
||||
join alf_audit_entry entry on (entry.audit_app_id = app.id)
|
||||
|
||||
<isEqual property="keyOrValueSearch" compareValue="true">
|
||||
<if test="keyOrValueSearch == true">
|
||||
join alf_prop_link sp_pl on (sp_pl.root_prop_id = entry.audit_values_id)
|
||||
</isEqual>
|
||||
</if>
|
||||
|
||||
join alf_prop_link pl on (pl.root_prop_id = entry.audit_values_id)
|
||||
join alf_prop_value pv on (pl.value_prop_id = pv.id)
|
||||
@@ -228,7 +237,7 @@
|
||||
</select>
|
||||
|
||||
<!-- Get audit entries -->
|
||||
<select id="select_AuditEntriesWithoutValues" parameterClass="AuditQueryParameters" resultMap="result_AuditQueryNoValues">
|
||||
<select id="select_AuditEntriesWithoutValues" parameterType="AuditQueryParameters" resultMap="result_AuditQueryNoValues">
|
||||
select
|
||||
app.app_name_id as audit_app_name_id,
|
||||
entry.id as audit_entry_id,
|
||||
@@ -239,12 +248,12 @@
|
||||
alf_audit_app app
|
||||
join alf_audit_entry entry on (entry.audit_app_id = app.id)
|
||||
|
||||
<isEqual property="keyOrValueSearch" compareValue="true">
|
||||
<if test="keyOrValueSearch == true">
|
||||
join alf_prop_link sp_pl on (sp_pl.root_prop_id = entry.audit_values_id)
|
||||
</isEqual>
|
||||
</if>
|
||||
|
||||
<include refid="select_AuditEntriesWhereSnippet"/>
|
||||
<include refid="select_AuditEntriesOrderBySnippet"/>
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,34 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.avm">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="AVMStore" type="org.alfresco.repo.domain.avm.AVMStoreEntity"/>
|
||||
<typeAlias alias="AVMNode" type="org.alfresco.repo.domain.avm.AVMNodeEntity"/>
|
||||
<typeAlias alias="AVMNodeAspect" type="org.alfresco.repo.domain.avm.AVMAspectEntity"/>
|
||||
<typeAlias alias="AVMChildEntry" type="org.alfresco.repo.domain.avm.AVMChildEntryEntity"/>
|
||||
<typeAlias alias="AVMVersionRoot" type="org.alfresco.repo.domain.avm.AVMVersionRootEntity"/>
|
||||
<typeAlias alias="AVMHistoryLink" type="org.alfresco.repo.domain.avm.AVMHistoryLinkEntity"/>
|
||||
<typeAlias alias="AVMMergeLink" type="org.alfresco.repo.domain.avm.AVMMergeLinkEntity"/>
|
||||
<typeAlias alias="AVMVersionLayeredNodeEntry" type="org.alfresco.repo.domain.avm.AVMVersionLayeredNodeEntryEntity"/>
|
||||
<typeAlias alias="AVMStoreProperty" type="org.alfresco.repo.domain.avm.AVMStorePropertyEntity"/>
|
||||
<typeAlias alias="AVMNodeProperty" type="org.alfresco.repo.domain.avm.AVMNodePropertyEntity"/>
|
||||
|
||||
<typeAlias alias="IdListOfIdsParam" type="org.alfresco.repo.domain.patch.ibatis.IdListOfIdsParam"/>
|
||||
<mapper namespace="alfresco.avm">
|
||||
|
||||
<!-- NOTE: MyBatis #224 - eg. Oracle -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_AVMStore" class="AVMStore">
|
||||
<resultMap id="result_AVMStore" type="AVMStore">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="nextVersion" column="next_version_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -37,22 +19,22 @@
|
||||
<result property="vers" column="vers" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMStoreProperty" class="AVMStoreProperty">
|
||||
<resultMap id="result_AVMStoreProperty" type="AVMStoreProperty">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="avmStoreId" column="avm_store_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameId" column="qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="actualType" column="actual_type_n" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="persistedType" column="persisted_type_n" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="actualType" column="actual_type_n" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="persistedType" column="persisted_type_n" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="isMultiValued" column="multi_valued" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="booleanValue" column="boolean_value" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="longValue" column="long_value" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="floatValue" column="float_value" jdbcType="FLOAT" javaType="java.lang.Float"/>
|
||||
<result property="doubleValue" column="double_value" jdbcType="DOUBLE" javaType="java.lang.Double"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="serializableValue" column="serializable_value" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMNode" class="AVMNode">
|
||||
<resultMap id="result_AVMNode" type="AVMNode">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="storeNewId" column="store_new_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="aclId" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -67,9 +49,9 @@
|
||||
<result property="modifiedDate" column="modDate" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="accessDate" column="accessDate" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="isRoot" column="is_root" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="deletedType" column="deletedType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="indirection" column="indirection" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="indirectionVersion" column="indirection_version" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="deletedType" column="deletedType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="indirection" column="indirection" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="indirectionVersion" column="indirection_version" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="primaryIndirection" column="primary_indirection" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="opacity" column="opacity" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="contentUrl" column="content_url" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -79,54 +61,54 @@
|
||||
<result property="vers" column="vers" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMNodeProperty" class="AVMNodeProperty">
|
||||
<resultMap id="result_AVMNodeProperty" type="AVMNodeProperty">
|
||||
<result property="nodeId" column="node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameId" column="qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="actualType" column="actual_type_n" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="persistedType" column="persisted_type_n" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="actualType" column="actual_type_n" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="persistedType" column="persisted_type_n" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="isMultiValued" column="multi_valued" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="booleanValue" column="boolean_value" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="longValue" column="long_value" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="floatValue" column="float_value" jdbcType="FLOAT" javaType="java.lang.Float"/>
|
||||
<result property="doubleValue" column="double_value" jdbcType="DOUBLE" javaType="java.lang.Double"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="serializableValue" column="serializable_value" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMNodeAspect" class="AVMNodeAspect">
|
||||
<resultMap id="result_AVMNodeAspect" type="AVMNodeAspect">
|
||||
<result property="nodeId" column="node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameId" column="qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMChildEntry" class="AVMChildEntry">
|
||||
<resultMap id="result_AVMChildEntry" type="AVMChildEntry">
|
||||
<result property="parentNodeId" column="parent_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="childNodeId" column="child_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMVersionRoot" class="AVMVersionRoot">
|
||||
<resultMap id="result_AVMVersionRoot" type="AVMVersionRoot">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="storeId" column="avm_store_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="rootNodeId" column="root_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version_id" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<result property="version" column="version_id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="creator" column="creator" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="createdDate" column="create_date" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="tag" column="tag" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="description" column="description" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="tag" column="tag" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="description" column="description" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMVersionLayeredNodeEntry" class="AVMVersionLayeredNodeEntry">
|
||||
<resultMap id="result_AVMVersionLayeredNodeEntry" type="AVMVersionLayeredNodeEntry">
|
||||
<result property="versionRootId" column="version_root_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="md5sum" column="md5sum" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="path" column="path" jdbcType="TEXT" javaType="java.lang.String"/>
|
||||
<result property="path" column="path" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMHistoryLink" class="AVMHistoryLink">
|
||||
<resultMap id="result_AVMHistoryLink" type="AVMHistoryLink">
|
||||
<result property="ancestorNodeId" column="ancestor" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="descendentNodeId" column="descendent" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AVMMergeLink" class="AVMMergeLink">
|
||||
<resultMap id="result_AVMMergeLink" type="AVMMergeLink">
|
||||
<result property="mergeFromNodeId" column="mfrom" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="mergeToNodeId" column="mto" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
@@ -135,49 +117,49 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_BoolMap" class="map">
|
||||
<parameterMap id="parameter_BoolMap" type="map">
|
||||
<parameter property="bool" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdFromMap" class="map">
|
||||
<parameterMap id="parameter_IdFromMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="from" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdToMap" class="map">
|
||||
<parameterMap id="parameter_IdToMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="to" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdFromToMap" class="map">
|
||||
<parameterMap id="parameter_IdFromToMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="from" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="to" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_KeyPattern" class="map">
|
||||
<parameterMap id="parameter_KeyPattern" type="map">
|
||||
<parameter property="uri" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="localname" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdAndKeyPattern" class="map">
|
||||
<parameterMap id="parameter_IdAndKeyPattern" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="uri" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="localname" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdPatternMap" class="map">
|
||||
<parameterMap id="parameter_IdPatternMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="pattern" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NodePropertyPatternMap" class="AVMNodeProperty">
|
||||
<parameter property="actualType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameterMap id="parameter_NodePropertyPatternMap" type="AVMNodeProperty">
|
||||
<parameter property="actualType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="isMultiValued" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="booleanValue" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="longValue" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -189,9 +171,9 @@
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_StorePropertyPatternMap" class="AVMStoreProperty">
|
||||
<parameter property="actualType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameterMap id="parameter_StorePropertyPatternMap" type="AVMStoreProperty">
|
||||
<parameter property="actualType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="isMultiValued" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="booleanValue" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="longValue" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -203,10 +185,10 @@
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdStorePropertyPatternMap" class="AVMStoreProperty">
|
||||
<parameterMap id="parameter_IdStorePropertyPatternMap" type="AVMStoreProperty">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="actualType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INT" javaType="java.lang.Integer"/>
|
||||
<parameter property="actualType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="persistedType" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="isMultiValued" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="booleanValue" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<parameter property="longValue" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -218,7 +200,7 @@
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameterMap_delete_PropertyUniqueContextByValues" class="map">
|
||||
<parameterMap id="parameterMap_delete_PropertyUniqueContextByValues" type="map">
|
||||
<parameter property="value1PropId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="value2PropId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="value3LikeStr" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -233,32 +215,32 @@
|
||||
|
||||
<sql id="insert_AVMStore_AutoIncrement">
|
||||
insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id)
|
||||
values (#version#, #name#, 0, null, null)
|
||||
values (#{version}, #{name}, 0, null, null)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMStore_Sequence">
|
||||
insert into avm_stores (id, next_version_id, name, vers, current_root_id, acl_id)
|
||||
values (#id#, #version#, #name#, 0, null, null)
|
||||
values (#{id}, #{version}, #{name}, 0, null, null)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMNode_AutoIncrement">
|
||||
insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length)
|
||||
values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#)
|
||||
values (#{classType}, #{deletedType}, #{version}, 0, #{storeNewId}, #{aclId}, #{guid}, #{owner}, #{creator}, #{createdDate}, #{modifier}, #{modifiedDate}, #{accessDate}, #{isRoot}, #{layerId}, #{indirection}, #{indirectionVersion}, #{primaryIndirection}, #{opacity}, #{contentUrl}, #{mimetype}, #{encoding}, #{length})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMNode_Sequence">
|
||||
insert into avm_nodes (id, class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length)
|
||||
values (#id#, #classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#)
|
||||
values (#{id}, #{classType}, #{deletedType}, #{version}, 0, #{storeNewId}, #{aclId}, #{guid}, #{owner}, #{creator}, #{createdDate}, #{modifier}, #{modifiedDate}, #{accessDate}, #{isRoot}, #{layerId}, #{indirection}, #{indirectionVersion}, #{primaryIndirection}, #{opacity}, #{contentUrl}, #{mimetype}, #{encoding}, #{length})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMVersionRoot_AutoIncrement">
|
||||
insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description)
|
||||
values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#)
|
||||
values (#{storeId}, #{rootNodeId}, #{version}, #{creator}, #{createdDate}, #{tag}, #{description})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMVersionRoot_Sequence">
|
||||
insert into avm_version_roots (id, avm_store_id, root_id, version_id, creator, create_date, tag, description)
|
||||
values (#id#, #storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#)
|
||||
values (#{id}, #{storeId}, #{rootNodeId}, #{version}, #{creator}, #{createdDate}, #{tag}, #{description})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AVMStoreProperty_AutoIncrement">
|
||||
@@ -278,27 +260,27 @@
|
||||
|
||||
<insert id="insert_AVMNodeAspect">
|
||||
insert into avm_aspects (node_id, qname_id)
|
||||
values (#nodeId#, #qnameId#)
|
||||
values (#{nodeId}, #{qnameId})
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMChildEntry">
|
||||
insert into avm_child_entries (parent_id, name, child_id)
|
||||
values (#parentNodeId#, #name#, #childNodeId#)
|
||||
values (#{parentNodeId}, #{name}, #{childNodeId})
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMHistoryLink">
|
||||
insert into avm_history_links (ancestor, descendent)
|
||||
values (#ancestorNodeId#, #descendentNodeId#)
|
||||
values (#{ancestorNodeId}, #{descendentNodeId})
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMMergeLink">
|
||||
insert into avm_merge_links (mfrom, mto)
|
||||
values (#mergeFromNodeId#, #mergeToNodeId#)
|
||||
values (#{mergeFromNodeId}, #{mergeToNodeId})
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMVersionLayeredNodeEntry">
|
||||
insert into avm_version_layered_node_entry (version_root_id, md5sum, path)
|
||||
values (#versionRootId#, #md5sum#, #path#)
|
||||
values (#{versionRootId}, #{md5sum}, #{path})
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMNodeProperty" parameterMap="parameter_NodePropertyPatternMap">
|
||||
@@ -311,22 +293,22 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get AVMStore by name -->
|
||||
<select id="select_AVMStoreByKey" parameterClass="AVMStore" resultMap="result_AVMStore">
|
||||
<select id="select_AVMStoreByKey" parameterType="AVMStore" resultMap="result_AVMStore">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_stores
|
||||
where
|
||||
name = #name#
|
||||
name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMStoreByKeyL" parameterClass="AVMStore" resultMap="result_AVMStore">
|
||||
<select id="select_AVMStoreByKeyL" parameterType="AVMStore" resultMap="result_AVMStore">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_stores
|
||||
where
|
||||
lower(name) = lower(#name#)
|
||||
lower(name) = lower(#{name})
|
||||
</select>
|
||||
|
||||
<!-- Get AVMStore by ID -->
|
||||
@@ -358,20 +340,20 @@
|
||||
</select>
|
||||
|
||||
<!-- Optimistic update of the store -->
|
||||
<update id="update_AVMStore" parameterClass="AVMStore">
|
||||
<update id="update_AVMStore" parameterType="AVMStore">
|
||||
update
|
||||
avm_stores
|
||||
set
|
||||
next_version_id = #nextVersion#,
|
||||
name = #name#,
|
||||
current_root_id = #rootNodeId#,
|
||||
acl_id = #aclId#,
|
||||
vers = #vers#
|
||||
next_version_id = #{nextVersion},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
current_root_id = #{rootNodeId,jdbcType=BIGINT},
|
||||
acl_id = #{aclId,jdbcType=BIGINT},
|
||||
vers = #{vers}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="vers" compareValue="0">
|
||||
and vers = (#vers#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="vers gt 0">
|
||||
and vers = (#{vers} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Delete AVMStore -->
|
||||
@@ -387,14 +369,14 @@
|
||||
<!-- AVM Store Property Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_AVMStoreProperty" parameterClass="AVMStoreProperty" resultMap="result_AVMStoreProperty">
|
||||
<select id="select_AVMStoreProperty" parameterType="AVMStoreProperty" resultMap="result_AVMStoreProperty">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_store_properties
|
||||
where
|
||||
avm_store_id = #avmStoreId# and
|
||||
qname_id = #qnameId#
|
||||
avm_store_id = #{avmStoreId} and
|
||||
qname_id = #{qnameId}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMStoreProperties" parameterMap="parameter_IdMap" resultMap="result_AVMStoreProperty">
|
||||
@@ -475,13 +457,13 @@
|
||||
qname_id = ?
|
||||
</update>
|
||||
|
||||
<delete id="delete_AVMStoreProperty" parameterClass="AVMStoreProperty">
|
||||
<delete id="delete_AVMStoreProperty" parameterType="AVMStoreProperty">
|
||||
delete
|
||||
from
|
||||
avm_store_properties
|
||||
where
|
||||
avm_store_id = #avmStoreId# and
|
||||
qname_id = #qnameId#
|
||||
avm_store_id = #{avmStoreId} and
|
||||
qname_id = #{qnameId}
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AVMStoreProperties" parameterMap="parameter_IdMap">
|
||||
@@ -514,7 +496,7 @@
|
||||
store_new_id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AVMNodes_IDs_newLayeredInStore" parameterMap="parameter_IdMap" resultClass="long">
|
||||
<select id="select_AVMNodes_IDs_newLayeredInStore" parameterMap="parameter_IdMap" resultType="long">
|
||||
select
|
||||
id
|
||||
from
|
||||
@@ -553,7 +535,7 @@
|
||||
class_type = 'layeredfile'
|
||||
</select>
|
||||
|
||||
<select id="select_ContentUrlsForPlainFiles" resultClass="String">
|
||||
<select id="select_ContentUrlsForPlainFiles" resultType="String">
|
||||
select
|
||||
content_url
|
||||
from
|
||||
@@ -573,90 +555,90 @@
|
||||
</update>
|
||||
|
||||
<!-- Optimistic update of the node -->
|
||||
<update id="update_AVMNode" parameterClass="AVMNode">
|
||||
<update id="update_AVMNode" parameterType="AVMNode">
|
||||
update
|
||||
avm_nodes
|
||||
set
|
||||
store_new_id = #storeNewId#,
|
||||
acl_id = #aclId#,
|
||||
layer_id = #layerId#,
|
||||
version_id = #version#,
|
||||
class_type = #classType#,
|
||||
deletedType = #deletedType#,
|
||||
owner = #owner#,
|
||||
modDate = #modifiedDate#,
|
||||
accessDate = #accessDate#,
|
||||
is_root = #isRoot#,
|
||||
lastModifier = #modifier#,
|
||||
indirection = #indirection#,
|
||||
indirection_version = #indirectionVersion#,
|
||||
primary_indirection = #primaryIndirection#,
|
||||
opacity = #opacity#,
|
||||
content_url = #contentUrl#,
|
||||
mime_type = #mimetype#,
|
||||
encoding = #encoding#,
|
||||
length = #length#,
|
||||
guid = #guid#,
|
||||
vers = #vers#
|
||||
store_new_id = #{storeNewId,jdbcType=BIGINT},
|
||||
acl_id = #{aclId,jdbcType=BIGINT},
|
||||
layer_id = #{layerId,jdbcType=BIGINT},
|
||||
version_id = #{version},
|
||||
class_type = #{classType},
|
||||
deletedType = #{deletedType,jdbcType=INTEGER},
|
||||
owner = #{owner},
|
||||
modDate = #{modifiedDate},
|
||||
accessDate = #{accessDate},
|
||||
is_root = #{isRoot,jdbcType=BIT},
|
||||
lastModifier = #{modifier},
|
||||
indirection = #{indirection,jdbcType=VARCHAR},
|
||||
indirection_version = #{indirectionVersion,jdbcType=INTEGER},
|
||||
primary_indirection = #{primaryIndirection,jdbcType=BIT},
|
||||
opacity = #{opacity,jdbcType=BIT},
|
||||
content_url = #{contentUrl,jdbcType=VARCHAR},
|
||||
mime_type = #{mimetype,jdbcType=VARCHAR},
|
||||
encoding = #{encoding,jdbcType=VARCHAR},
|
||||
length = #{length,jdbcType=BIGINT},
|
||||
guid = #{guid,jdbcType=VARCHAR},
|
||||
vers = #{vers}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="vers" compareValue="0">
|
||||
and vers = (#vers#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="vers gt 0">
|
||||
and vers = (#{vers} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="update_AVMNode_modTimeAndGuid" parameterClass="AVMNode">
|
||||
<update id="update_AVMNode_modTimeAndGuid" parameterType="AVMNode">
|
||||
update
|
||||
avm_nodes
|
||||
set
|
||||
modDate = #modifiedDate#,
|
||||
guid = #guid#,
|
||||
vers = #vers#
|
||||
modDate = #{modifiedDate},
|
||||
guid = #{guid,jdbcType=VARCHAR},
|
||||
vers = #{vers}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="vers" compareValue="0">
|
||||
and vers = (#vers#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="vers gt 0">
|
||||
and vers = (#{vers} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="update_AVMNode_modTimeAndContentData" parameterClass="AVMNode">
|
||||
<update id="update_AVMNode_modTimeAndContentData" parameterType="AVMNode">
|
||||
update
|
||||
avm_nodes
|
||||
set
|
||||
modDate = #modifiedDate#,
|
||||
content_url = #contentUrl#,
|
||||
mime_type = #mimetype#,
|
||||
encoding = #encoding#,
|
||||
length = #length#,
|
||||
vers = #vers#
|
||||
modDate = #{modifiedDate},
|
||||
content_url = #{contentUrl,jdbcType=VARCHAR},
|
||||
mime_type = #{mimetype,jdbcType=VARCHAR},
|
||||
encoding = #{encoding,jdbcType=VARCHAR},
|
||||
length = #{length,jdbcType=BIGINT},
|
||||
vers = #{vers}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="vers" compareValue="0">
|
||||
and vers = (#vers#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="vers gt 0">
|
||||
and vers = (#{vers} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- for patch -->
|
||||
<update id="update_AVMNodeList_nullifyAcl" parameterClass="list">
|
||||
<update id="update_AVMNodeList_nullifyAcl" parameterType="list">
|
||||
update
|
||||
avm_nodes set acl_id = null
|
||||
where
|
||||
acl_id is not null
|
||||
and id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- for patch -->
|
||||
<update id="update_AVMNodeList_setAcl" parameterClass="IdListOfIdsParam">
|
||||
<update id="update_AVMNodeList_setAcl" parameterType="IdListOfIdsParam">
|
||||
update
|
||||
avm_nodes set acl_id = #id#
|
||||
avm_nodes set acl_id = #{id,jdbcType=BIGINT}
|
||||
where
|
||||
id in
|
||||
<iterate property="listOfIds" open="(" close=")" conjunction=",">
|
||||
#listOfIds[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="listOfIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="delete_AVMNode" parameterMap="parameter_IdMap">
|
||||
@@ -671,14 +653,14 @@
|
||||
<!-- AVM Node Property Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_AVMNodeProperty" parameterClass="AVMNodeProperty" resultMap="result_AVMNodeProperty">
|
||||
<select id="select_AVMNodeProperty" parameterType="AVMNodeProperty" resultMap="result_AVMNodeProperty">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_node_properties
|
||||
where
|
||||
node_id = #nodeId# and
|
||||
qname_id = #qnameId#
|
||||
node_id = #{nodeId} and
|
||||
qname_id = #{qnameId}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMNodeProperties" parameterMap="parameter_IdMap" resultMap="result_AVMNodeProperty">
|
||||
@@ -709,13 +691,13 @@
|
||||
qname_id = ?
|
||||
</update>
|
||||
|
||||
<delete id="delete_AVMNodeProperty" parameterClass="AVMNodeProperty">
|
||||
<delete id="delete_AVMNodeProperty" parameterType="AVMNodeProperty">
|
||||
delete
|
||||
from
|
||||
avm_node_properties
|
||||
where
|
||||
node_id = #nodeId# and
|
||||
qname_id = #qnameId#
|
||||
node_id = #{nodeId} and
|
||||
qname_id = #{qnameId}
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AVMNodeProperties" parameterMap="parameter_IdMap">
|
||||
@@ -730,7 +712,7 @@
|
||||
<!-- AVM VersionRoot Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_AVMVersionRootMaxVersionID" parameterMap="parameter_IdMap" resultClass="int">
|
||||
<select id="select_AVMVersionRootMaxVersionID" parameterMap="parameter_IdMap" resultType="int">
|
||||
select
|
||||
max(version_id)
|
||||
from
|
||||
@@ -739,19 +721,19 @@
|
||||
avm_store_id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AVMVersionRootMaxVersion" parameterClass="AVMStore" resultMap="result_AVMVersionRoot">
|
||||
<select id="select_AVMVersionRootMaxVersion" parameterType="AVMStore" resultMap="result_AVMVersionRoot">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_version_roots
|
||||
where
|
||||
avm_store_id = #id#
|
||||
avm_store_id = #{id}
|
||||
and version_id = (select
|
||||
max(vr.version_id)
|
||||
from
|
||||
avm_version_roots vr
|
||||
where
|
||||
vr.avm_store_id = #id#
|
||||
vr.avm_store_id = #{id}
|
||||
)
|
||||
</select>
|
||||
|
||||
@@ -773,14 +755,14 @@
|
||||
root_id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AVMVersionRootByStoreVersion" parameterClass="AVMVersionRoot" resultMap="result_AVMVersionRoot">
|
||||
<select id="select_AVMVersionRootByStoreVersion" parameterType="AVMVersionRoot" resultMap="result_AVMVersionRoot">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_version_roots
|
||||
where
|
||||
avm_store_id = #storeId# and
|
||||
version_id = #version#
|
||||
avm_store_id = #{storeId} and
|
||||
version_id = #{version}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMVersionRootsByStoreId" parameterMap="parameter_IdMap" resultMap="result_AVMVersionRoot">
|
||||
@@ -866,14 +848,14 @@
|
||||
</select>
|
||||
|
||||
<!-- Optimistic update of the version root -->
|
||||
<update id="update_AVMVersionRoot" parameterClass="AVMVersionRoot">
|
||||
<update id="update_AVMVersionRoot" parameterType="AVMVersionRoot">
|
||||
update
|
||||
avm_version_roots
|
||||
set
|
||||
tag = #tag#,
|
||||
description = #description#
|
||||
tag = #{tag},
|
||||
description = #{description}
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delete_AVMVersionRoot" parameterMap="parameter_IdMap">
|
||||
@@ -910,7 +892,7 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get AVMNodeAspects for given AVMNode ID -->
|
||||
<select id="select_AVMNodeAspects" parameterMap="parameter_IdMap" resultClass="long">
|
||||
<select id="select_AVMNodeAspects" parameterMap="parameter_IdMap" resultType="long">
|
||||
select
|
||||
qname_id
|
||||
from
|
||||
@@ -920,13 +902,13 @@
|
||||
</select>
|
||||
|
||||
<!-- Delete AVMNodeAspect -->
|
||||
<delete id="delete_AVMNodeAspect" parameterClass="AVMNodeAspect">
|
||||
<delete id="delete_AVMNodeAspect" parameterType="AVMNodeAspect">
|
||||
delete
|
||||
from
|
||||
avm_aspects
|
||||
where
|
||||
node_id = #nodeId# and
|
||||
qname_id = #qnameId#
|
||||
node_id = #{nodeId} and
|
||||
qname_id = #{qnameId}
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AVMNodeAspects" parameterMap="parameter_IdMap">
|
||||
@@ -942,26 +924,26 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get AVMChildEntry -->
|
||||
<select id="select_AVMChildEntry" parameterClass="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
<select id="select_AVMChildEntry" parameterType="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
name = #name# and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
name = #{name} and
|
||||
child_id = #{childNodeId}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMChildEntryL" parameterClass="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
<select id="select_AVMChildEntryL" parameterType="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
lower(name) = lower(#name#) and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
lower(name) = lower(#{name}) and
|
||||
child_id = #{childNodeId}
|
||||
</select>
|
||||
|
||||
<!-- Get AVMNodeChildEntries by parent node ID -->
|
||||
@@ -1006,98 +988,98 @@
|
||||
</select>
|
||||
|
||||
<!-- Get AVMChildEntry by parent node ID and name -->
|
||||
<select id="select_AVMChildEntryByParentAndName" parameterClass="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
<select id="select_AVMChildEntryByParentAndName" parameterType="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
name = #name#
|
||||
parent_id = #{parentNodeId} and
|
||||
name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="select_AVMChildEntryByParentAndNameL" parameterClass="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
<select id="select_AVMChildEntryByParentAndNameL" parameterType="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
lower(name) = lower(#name#)
|
||||
parent_id = #{parentNodeId} and
|
||||
lower(name) = lower(#{name})
|
||||
</select>
|
||||
|
||||
<!-- Get AVMChildEntry by parent node ID and child node ID -->
|
||||
<select id="select_AVMChildEntryByParentAndChild" parameterClass="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
<select id="select_AVMChildEntryByParentAndChild" parameterType="AVMChildEntry" resultMap="result_AVMChildEntry">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
child_id = #{childNodeId}
|
||||
</select>
|
||||
|
||||
<!-- Remove AVMChildEntry -->
|
||||
<!-- unused
|
||||
<delete id="delete_AVMChildEntry" parameterClass="AVMChildEntry">
|
||||
<delete id="delete_AVMChildEntry" parameterType="AVMChildEntry">
|
||||
delete
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
name = #name# and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
name = #{name} and
|
||||
child_id = #{childNodeId#
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AVMChildEntryL" parameterClass="AVMChildEntry">
|
||||
<delete id="delete_AVMChildEntryL" parameterType="AVMChildEntry">
|
||||
delete
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
parent_id = #{parentNodeId} and
|
||||
lower(name) = lower(#name#) and
|
||||
child_id = #childNodeId#
|
||||
child_id = #{childNodeId#
|
||||
</delete>
|
||||
-->
|
||||
|
||||
<!-- Update child entry name (currently used for specific rename 'case' only) -->
|
||||
<update id="update_AVMChildEntry" parameterClass="AVMChildEntry">
|
||||
<update id="update_AVMChildEntry" parameterType="AVMChildEntry">
|
||||
update
|
||||
avm_child_entries
|
||||
set
|
||||
name = #name#
|
||||
name = #{name}
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
child_id = #{childNodeId}
|
||||
</update>
|
||||
|
||||
<!-- Remove AVMChildEntry by parent node ID and name -->
|
||||
<delete id="delete_AVMChildEntryByParentAndName" parameterClass="AVMChildEntry">
|
||||
<delete id="delete_AVMChildEntryByParentAndName" parameterType="AVMChildEntry">
|
||||
delete
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
name = #name#
|
||||
parent_id = #{parentNodeId} and
|
||||
name = #{name}
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AVMChildEntryByParentAndNameL" parameterClass="AVMChildEntry">
|
||||
<delete id="delete_AVMChildEntryByParentAndNameL" parameterType="AVMChildEntry">
|
||||
delete
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
lower(name) = lower(#name#)
|
||||
parent_id = #{parentNodeId} and
|
||||
lower(name) = lower(#{name})
|
||||
</delete>
|
||||
|
||||
<!-- Remove AVMChildEntry by parent node ID and child node ID -->
|
||||
<delete id="delete_AVMChildEntryByParentAndChild" parameterClass="AVMChildEntry">
|
||||
<delete id="delete_AVMChildEntryByParentAndChild" parameterType="AVMChildEntry">
|
||||
delete
|
||||
from
|
||||
avm_child_entries
|
||||
where
|
||||
parent_id = #parentNodeId# and
|
||||
child_id = #childNodeId#
|
||||
parent_id = #{parentNodeId} and
|
||||
child_id = #{childNodeId}
|
||||
</delete>
|
||||
|
||||
<!-- Remove AVMNodeChildEntries -->
|
||||
@@ -1142,13 +1124,13 @@
|
||||
mto = ?
|
||||
</select>
|
||||
|
||||
<delete id="delete_AVMMergeLink" parameterClass="AVMMergeLink">
|
||||
<delete id="delete_AVMMergeLink" parameterType="AVMMergeLink">
|
||||
delete
|
||||
from
|
||||
avm_merge_links
|
||||
where
|
||||
mfrom = #mergeFromNodeId# and
|
||||
mto = #mergeToNodeId#
|
||||
mfrom = #{mergeFromNodeId} and
|
||||
mto = #{mergeToNodeId}
|
||||
</delete>
|
||||
|
||||
<!-- -->
|
||||
@@ -1173,23 +1155,23 @@
|
||||
descendent = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AVMHistoryLink" parameterClass="AVMHistoryLink" resultMap="result_AVMHistoryLink">
|
||||
<select id="select_AVMHistoryLink" parameterType="AVMHistoryLink" resultMap="result_AVMHistoryLink">
|
||||
select
|
||||
*
|
||||
from
|
||||
avm_history_links
|
||||
where
|
||||
ancestor = #ancestorNodeId# and
|
||||
descendent = #descendentNodeId#
|
||||
ancestor = #{ancestorNodeId} and
|
||||
descendent = #{descendentNodeId}
|
||||
</select>
|
||||
|
||||
<delete id="delete_AVMHistoryLink" parameterClass="AVMHistoryLink">
|
||||
<delete id="delete_AVMHistoryLink" parameterType="AVMHistoryLink">
|
||||
delete
|
||||
from
|
||||
avm_history_links
|
||||
where
|
||||
ancestor = #ancestorNodeId# and
|
||||
descendent = #descendentNodeId#
|
||||
ancestor = #{ancestorNodeId} and
|
||||
descendent = #{descendentNodeId}
|
||||
</delete>
|
||||
|
||||
|
||||
@@ -1290,4 +1272,4 @@
|
||||
)
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,40 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.content">
|
||||
<mapper namespace="alfresco.content">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Mimetype" type="org.alfresco.repo.domain.mimetype.MimetypeEntity"/>
|
||||
<typeAlias alias="Encoding" type="org.alfresco.repo.domain.encoding.EncodingEntity"/>
|
||||
<typeAlias alias="ContentUrl" type="org.alfresco.repo.domain.contentdata.ContentUrlEntity"/>
|
||||
<typeAlias alias="ContentUrlUpdate" type="org.alfresco.repo.domain.contentdata.ContentUrlUpdateEntity"/>
|
||||
<typeAlias alias="ContentData" type="org.alfresco.repo.domain.contentdata.ContentDataEntity"/>
|
||||
<typeAlias alias="ContentUrlOrphanQuery" type="org.alfresco.repo.domain.contentdata.ContentUrlOrphanQuery"/>
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
<!-- NOTE: MyBatis #224 - eg. Oracle -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_Mimetype" class="Mimetype">
|
||||
<resultMap id="result_Mimetype" type="Mimetype">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="mimetype" column="mimetype_str" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Encoding" class="Encoding">
|
||||
<resultMap id="result_Encoding" type="Encoding">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="encoding" column="encoding_str" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_ContentUrl" class="ContentUrl">
|
||||
<resultMap id="result_ContentUrl" type="ContentUrl">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="contentUrl" column="content_url" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="contentUrlShort" column="content_url_short" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -43,7 +31,7 @@
|
||||
<result property="orphanTime" column="orphan_time" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_ContentData" class="ContentData">
|
||||
<resultMap id="result_ContentData" type="ContentData">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="contentUrlId" column="content_url_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -58,16 +46,16 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NodeAndQNameMap" class="map">
|
||||
<parameterMap id="parameter_NodeAndQNameMap" type="map">
|
||||
<parameter property="nodeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_ContentUrl" class="ContentUrl">
|
||||
<parameterMap id="parameter_ContentUrl" type="ContentUrl">
|
||||
<parameter property="contentUrl" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="contentUrlShort" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="contentUrlCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -75,7 +63,7 @@
|
||||
<parameter property="orphanTime" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_ContentData" class="ContentData">
|
||||
<parameterMap id="parameter_ContentData" type="ContentData">
|
||||
<parameter property="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="contentUrlId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="mimetypeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -89,12 +77,22 @@
|
||||
|
||||
<sql id="insert_Mimetype_AutoIncrement">
|
||||
insert into alf_mimetype (version, mimetype_str)
|
||||
values (#version#, #mimetype#)
|
||||
values (#{version}, #{mimetype})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Mimetype_Sequence">
|
||||
insert into alf_mimetype (id, version, mimetype_str)
|
||||
values (#{id}, #{version}, #{mimetype})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Encoding_AutoIncrement">
|
||||
insert into alf_encoding (version, encoding_str)
|
||||
values (#version#, #encoding#)
|
||||
values (#{version}, #{encoding})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Encoding_Sequence">
|
||||
insert into alf_encoding (id, version, encoding_str)
|
||||
values (#{id}, #{version}, #{encoding})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_ContentUrl_AutoIncrement">
|
||||
@@ -102,91 +100,101 @@
|
||||
values (?, ?, ?, ?, ?)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_ContentUrl_Sequence">
|
||||
insert into alf_content_url (id, content_url, content_url_short, content_url_crc, content_size, orphan_time)
|
||||
values (#{id}, #{contentUrl}, #{contentUrlShort}, #{contentUrlCrc}, #{size}, #{orphanTime,jdbcType=BIGINT})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_ContentData_AutoIncrement">
|
||||
insert into alf_content_data (version, content_url_id, content_mimetype_id, content_encoding_id, content_locale_id)
|
||||
values (?, ?, ?, ?, ?)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_ContentData_Sequence">
|
||||
insert into alf_content_data (id, version, content_url_id, content_mimetype_id, content_encoding_id, content_locale_id)
|
||||
values (#{id}, #{version}, #{contentUrlId,jdbcType=BIGINT}, #{mimetypeId,jdbcType=BIGINT}, #{encodingId,jdbcType=BIGINT}, #{localeId,jdbcType=BIGINT})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
<!-- Statements -->
|
||||
<!-- -->
|
||||
|
||||
<!-- Get the mimetype entity by mimetype -->
|
||||
<select id="select_MimetypeByKey" parameterClass="Mimetype" resultMap="result_Mimetype">
|
||||
<select id="select_MimetypeByKey" parameterType="Mimetype" resultMap="result_Mimetype">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_mimetype
|
||||
where
|
||||
mimetype_str = #mimetype#
|
||||
mimetype_str = #{mimetype}
|
||||
</select>
|
||||
|
||||
<!-- Get a mimetype based on the ID -->
|
||||
<select id="select_MimetypeById" parameterClass="Mimetype" resultMap="result_Mimetype">
|
||||
<select id="select_MimetypeById" parameterType="Mimetype" resultMap="result_Mimetype">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_mimetype
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the encoding entity by encoding -->
|
||||
<select id="select_EncodingByKey" parameterClass="Encoding" resultMap="result_Encoding">
|
||||
<select id="select_EncodingByKey" parameterType="Encoding" resultMap="result_Encoding">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_encoding
|
||||
where
|
||||
encoding_str = #encoding#
|
||||
encoding_str = #{encoding}
|
||||
</select>
|
||||
|
||||
<!-- Get a encoding based on the ID -->
|
||||
<select id="select_EncodingById" parameterClass="Encoding" resultMap="result_Encoding">
|
||||
<select id="select_EncodingById" parameterType="Encoding" resultMap="result_Encoding">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_encoding
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the content URL entity by ID -->
|
||||
<select id="select_ContentUrlById" parameterClass="ContentUrl" resultMap="result_ContentUrl">
|
||||
<select id="select_ContentUrlById" parameterType="ContentUrl" resultMap="result_ContentUrl">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_content_url
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the content URL entity by unique key -->
|
||||
<select id="select_ContentUrlByKey" parameterClass="ContentUrl" resultMap="result_ContentUrl">
|
||||
<select id="select_ContentUrlByKey" parameterType="ContentUrl" resultMap="result_ContentUrl">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_content_url
|
||||
where
|
||||
content_url_short = #contentUrlShort# and
|
||||
content_url_crc = #contentUrlCrc#
|
||||
content_url_short = #{contentUrlShort} and
|
||||
content_url_crc = #{contentUrlCrc}
|
||||
</select>
|
||||
|
||||
<!-- Get unreferenced content URL entity by unique key -->
|
||||
<select id="select_ContentUrlByKeyUnreferenced" parameterClass="ContentUrl" resultMap="result_ContentUrl">
|
||||
<select id="select_ContentUrlByKeyUnreferenced" parameterType="ContentUrl" resultMap="result_ContentUrl">
|
||||
select
|
||||
cu.*
|
||||
from
|
||||
alf_content_url cu
|
||||
left outer join alf_content_data cd on (cd.content_url_id = cu.id)
|
||||
where
|
||||
content_url_short = #contentUrlShort# and
|
||||
content_url_crc = #contentUrlCrc# and
|
||||
content_url_short = #{contentUrlShort} and
|
||||
content_url_crc = #{contentUrlCrc} and
|
||||
cd.id is null
|
||||
</select>
|
||||
|
||||
<!-- Get content URL entities that were orphaned before a give time -->
|
||||
<select id="select_ContentUrlsOrphaned" parameterClass="ContentUrlOrphanQuery" resultMap="result_ContentUrl">
|
||||
<select id="select_ContentUrlsOrphaned" parameterType="ContentUrlOrphanQuery" resultMap="result_ContentUrl">
|
||||
<![CDATA[
|
||||
select
|
||||
cu.*
|
||||
@@ -196,46 +204,46 @@
|
||||
where
|
||||
cd.id is null and
|
||||
cu.orphan_time > 0 and
|
||||
cu.orphan_time < #maxOrphanTimeExclusive# and
|
||||
cu.orphan_time < #{maxOrphanTimeExclusive} and
|
||||
cu.orphan_time is not null
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- Update a specific mimetype -->
|
||||
<update id="update_Mimetype" parameterClass="Mimetype">
|
||||
<update id="update_Mimetype" parameterType="Mimetype">
|
||||
update
|
||||
alf_mimetype
|
||||
set
|
||||
mimetype_str = #mimetype#
|
||||
mimetype_str = #{mimetype}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Mark a content URL entity as orphaned -->
|
||||
<update id="update_ContentUrlOrphanTime" parameterClass="ContentUrlUpdate">
|
||||
<update id="update_ContentUrlOrphanTime" parameterType="ContentUrlUpdate">
|
||||
update
|
||||
alf_content_url
|
||||
set
|
||||
orphan_time = #orphanTime#
|
||||
orphan_time = #{orphanTime,jdbcType=BIGINT}
|
||||
where
|
||||
id = #id# and
|
||||
<isNull property="oldOrphanTime">orphan_time is null</isNull>
|
||||
<isNotNull property="oldOrphanTime">orphan_time = #oldOrphanTime#</isNotNull>
|
||||
id = #{id} and
|
||||
<if test="oldOrphanTime == null">orphan_time is null</if>
|
||||
<if test="oldOrphanTime != null">orphan_time = #{oldOrphanTime}</if>
|
||||
</update>
|
||||
|
||||
<!-- Delete ContentUrl entity -->
|
||||
<delete id="delete_ContentUrls" parameterClass="list">
|
||||
<delete id="delete_ContentUrls" parameterType="list">
|
||||
delete
|
||||
from
|
||||
alf_content_url
|
||||
where
|
||||
id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- Get the ContentData entity by ID -->
|
||||
@@ -257,31 +265,34 @@
|
||||
</select>
|
||||
|
||||
<!-- Get the ContentData entity by Node and property QName -->
|
||||
<select id="select_ContentDataByNodeAndQName" parameterClass="Ids" resultClass="long">
|
||||
<select id="select_ContentDataByNodeAndQName" parameterType="Ids" resultType="long">
|
||||
select
|
||||
np.long_value as id
|
||||
from
|
||||
alf_node_properties np
|
||||
where
|
||||
np.node_id = #idOne# and
|
||||
np.qname_id in <iterate property="ids" open="(" close=")" conjunction=",">#ids[]#</iterate> and
|
||||
(np.actual_type_n = 3 or np.actual_type_n = 21)
|
||||
np.node_id = #{idOne} and
|
||||
np.qname_id in
|
||||
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and (np.actual_type_n = 3 or np.actual_type_n = 21)
|
||||
</select>
|
||||
|
||||
<update id="update_ContentData" parameterClass="ContentData">
|
||||
<update id="update_ContentData" parameterType="ContentData">
|
||||
update
|
||||
alf_content_data
|
||||
set
|
||||
version = #version#,
|
||||
content_url_id = #contentUrlId#,
|
||||
content_mimetype_id = #mimetypeId#,
|
||||
content_encoding_id = #encodingId#,
|
||||
content_locale_id = #localeId#
|
||||
version = #{version},
|
||||
content_url_id = #{contentUrlId,jdbcType=BIGINT},
|
||||
content_mimetype_id = #{mimetypeId,jdbcType=BIGINT},
|
||||
content_encoding_id = #{encodingId,jdbcType=BIGINT},
|
||||
content_locale_id = #{localeId,jdbcType=BIGINT}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Delete ContentData entity -->
|
||||
@@ -293,4 +304,4 @@
|
||||
id = ?
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,22 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.locale">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Locale" type="org.alfresco.repo.domain.locale.LocaleEntity"/>
|
||||
<mapper namespace="alfresco.locale">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_Locale" class="Locale">
|
||||
<resultMap id="result_Locale" type="Locale">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="localeStr" column="locale_str" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -26,11 +18,11 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_LocaleStr" class="map">
|
||||
<parameterMap id="parameter_LocaleStr" type="map">
|
||||
<parameter property="str" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_LocaleId" class="map">
|
||||
<parameterMap id="parameter_LocaleId" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
@@ -40,9 +32,13 @@
|
||||
|
||||
<sql id="insert_Locale_AutoIncrement">
|
||||
insert into alf_locale (version, locale_str)
|
||||
values (#version#, #localeStr#)
|
||||
values (#{version}, #{localeStr})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Locale_Sequence">
|
||||
insert into alf_locale (id, version, locale_str)
|
||||
values (#{id}, #{version}, #{localeStr})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
<!-- Statements -->
|
||||
@@ -66,4 +62,4 @@
|
||||
locale_str = ?
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,30 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.lock">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="LockResource" type="org.alfresco.repo.domain.locks.LockResourceEntity"/>
|
||||
<typeAlias alias="Lock" type="org.alfresco.repo.domain.locks.LockEntity"/>
|
||||
<mapper namespace="alfresco.lock">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_LockResource" class="LockResource">
|
||||
<resultMap id="result_LockResource" type="LockResource">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameNamespaceId" column="qname_ns_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameLocalName" column="qname_localname" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Lock" class="Lock">
|
||||
<resultMap id="result_Lock" type="Lock">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="sharedResourceId" column="shared_resource_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -38,7 +29,7 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_ExclusiveLockUpdateMap" class="map">
|
||||
<parameterMap id="parameter_ExclusiveLockUpdateMap" type="map">
|
||||
<parameter property="newLockToken" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="newStartTime" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="newExpiryTime" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -52,12 +43,22 @@
|
||||
|
||||
<sql id="insert_LockResource_AutoIncrement">
|
||||
insert into alf_lock_resource (version, qname_ns_id, qname_localname)
|
||||
values (#version#, #qnameNamespaceId#, #qnameLocalName#)
|
||||
values (#{version}, #{qnameNamespaceId}, #{qnameLocalName})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_LockResource_Sequence">
|
||||
insert into alf_lock_resource (id, version, qname_ns_id, qname_localname)
|
||||
values (#{id}, #{version}, #{qnameNamespaceId}, #{qnameLocalName})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Lock_AutoIncrement">
|
||||
insert into alf_lock (version, shared_resource_id, excl_resource_id, lock_token, start_time, expiry_time)
|
||||
values (#version#, #sharedResourceId#, #exclusiveResourceId#, #lockToken#, #startTime#, #expiryTime#)
|
||||
values (#{version}, #{sharedResourceId}, #{exclusiveResourceId}, #{lockToken}, #{startTime}, #{expiryTime})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Lock_Sequence">
|
||||
insert into alf_lock (id, version, shared_resource_id, excl_resource_id, lock_token, start_time, expiry_time)
|
||||
values (#{id}, #{version}, #{sharedResourceId}, #{exclusiveResourceId}, #{lockToken}, #{startTime}, #{expiryTime})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
@@ -65,35 +66,35 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get the lock resource entity by qualified name -->
|
||||
<select id="select_LockResourceByQName" parameterClass="LockResource" resultMap="result_LockResource">
|
||||
<select id="select_LockResourceByQName" parameterType="LockResource" resultMap="result_LockResource">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_lock_resource
|
||||
where
|
||||
qname_ns_id = #qnameNamespaceId# and
|
||||
qname_localname = #qnameLocalName#
|
||||
qname_ns_id = #{qnameNamespaceId} and
|
||||
qname_localname = #{qnameLocalName}
|
||||
</select>
|
||||
|
||||
<!-- Get a lock based on the ID -->
|
||||
<select id="select_LockByID" parameterClass="Lock" resultMap="result_Lock">
|
||||
<select id="select_LockByID" parameterType="Lock" resultMap="result_Lock">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_lock
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get a lock based on the unique key (shared and exclusive lock IDs) -->
|
||||
<select id="select_LockByKey" parameterClass="Lock" resultMap="result_Lock">
|
||||
<select id="select_LockByKey" parameterType="Lock" resultMap="result_Lock">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_lock
|
||||
where
|
||||
shared_resource_id = #sharedResourceId# and
|
||||
excl_resource_id = #exclusiveResourceId#
|
||||
shared_resource_id = #{sharedResourceId} and
|
||||
excl_resource_id = #{exclusiveResourceId}
|
||||
</select>
|
||||
|
||||
<!-- Get all locks for a given list of resource IDs -->
|
||||
@@ -104,27 +105,25 @@
|
||||
alf_lock
|
||||
where
|
||||
shared_resource_id in
|
||||
<dynamic>
|
||||
<iterate open="(" close=")" conjunction=", ">
|
||||
#[]#
|
||||
</iterate>
|
||||
</dynamic>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- Optimistic update of the lock -->
|
||||
<update id="update_Lock" parameterClass="Lock">
|
||||
<update id="update_Lock" parameterType="Lock">
|
||||
update
|
||||
alf_lock
|
||||
set
|
||||
version = #version#,
|
||||
lock_token = #lockToken#,
|
||||
start_time = #startTime#,
|
||||
expiry_time = #expiryTime#
|
||||
version = #{version},
|
||||
lock_token = #{lockToken},
|
||||
start_time = #{startTime},
|
||||
expiry_time = #{expiryTime}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Update locks for a given exclusive lock -->
|
||||
@@ -141,4 +140,4 @@
|
||||
lock_token = ?
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
File diff suppressed because it is too large
Load Diff
@@ -1,33 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.node">
|
||||
<mapper namespace="alfresco.node.update">
|
||||
|
||||
<!--
|
||||
The ANSI form requires a subselect. This is not compatible with MySQL.
|
||||
-->
|
||||
<update id="update_PrimaryChildrenSharedAcl" parameterClass="PrimaryChildrenAclUpdate">
|
||||
<update id="update_PrimaryChildrenSharedAcl" parameterType="PrimaryChildrenAclUpdate">
|
||||
update
|
||||
alf_node
|
||||
set
|
||||
acl_id = #newSharedAclId#
|
||||
acl_id = #{newSharedAclId}
|
||||
where id in
|
||||
(
|
||||
select n.id
|
||||
from
|
||||
alf_node n
|
||||
join alf_child_assoc ca on (n.id = ca.child_node_id and ca.is_primary = #isPrimary#)
|
||||
join alf_child_assoc ca on (n.id = ca.child_node_id and ca.is_primary = #{isPrimary})
|
||||
where
|
||||
ca.parent_node_id = #primaryParentNodeId#
|
||||
ca.parent_node_id = #{primaryParentNodeId}
|
||||
and
|
||||
(
|
||||
n.acl_id is null
|
||||
<isNotNull property="optionalOldSharedAclIdInAdditionToNull"> OR n.acl_id = #optionalOldSharedAclIdInAdditionToNull#</isNotNull>
|
||||
<if test="optionalOldSharedAclIdInAdditionToNull != null"> OR n.acl_id = #{optionalOldSharedAclIdInAdditionToNull}</if>
|
||||
)
|
||||
)
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,24 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.patch">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
<typeAlias alias="SizeCurrentParams" type="org.alfresco.repo.domain.patch.ibatis.SizeCurrentParams"/>
|
||||
<typeAlias alias="DuplicateEntry" type="org.alfresco.repo.admin.patch.impl.DuplicateEntry" />
|
||||
<mapper namespace="alfresco.patch">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_admOldContentProp" class="java.util.HashMap">
|
||||
<resultMap id="result_admOldContentProp" type="java.util.HashMap">
|
||||
<result property="nodeId" column="node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameId" column="qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="listIndex" column="list_index" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
@@ -26,12 +16,12 @@
|
||||
<result property="stringValue" column="string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_authoritiesAndCrc" class="java.util.HashMap">
|
||||
<resultMap id="result_authoritiesAndCrc" type="java.util.HashMap">
|
||||
<result property="authority" column="authority" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="crc" column="crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_childAssocsForCrc" class="java.util.HashMap">
|
||||
<resultMap id="result_childAssocsForCrc" type="java.util.HashMap">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="typeQNameId" column="type_qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameNamespaceId" column="qname_ns_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -42,44 +32,44 @@
|
||||
<result property="childNodeName" column="child_node_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_nodeIdAndName" class="java.util.HashMap">
|
||||
<resultMap id="result_nodeIdAndName" type="java.util.HashMap">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap class="java.util.HashMap" id="result_admTenant">
|
||||
<resultMap type="java.util.HashMap" id="result_admTenant">
|
||||
<result property="tenantDomain" column="tenantDomain" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="isEnabled" column="isEnabled" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="rootDir" column="rootDir" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap class="java.util.HashMap" id="result_avmLock">
|
||||
<resultMap type="java.util.HashMap" id="result_avmLock">
|
||||
<result property="wpStoreId" column="wpStoreId" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="relPath" column="relPath" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="avmStore" column="avmStore" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="owner1" column="owner1" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap class="java.util.HashMap" id="result_PBB">
|
||||
<resultMap type="java.util.HashMap" id="result_PBB">
|
||||
<result property="componentName" column="componentName" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="propName" column="propName" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="propValue" column="propValue" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap class="java.util.HashMap" id="result_ChainingURS">
|
||||
<resultMap type="java.util.HashMap" id="result_ChainingURS">
|
||||
<result property="label" column="label" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="zoneId" column="zoneId" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="lastModified" column="lastModified" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_DuplicateEntry" class="DuplicateEntry">
|
||||
<resultMap id="result_DuplicateEntry" type="DuplicateEntry">
|
||||
<result property="id" column="child_id" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
<result property="parentId" column="parent_id" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
<result property="amount" column="cnt" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_aclIneritanceIssue" class="java.util.HashMap">
|
||||
<resultMap id="result_aclIneritanceIssue" type="java.util.HashMap">
|
||||
<result property="childAclId" column="child_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="childAclType" column="child_acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="primaryParentAclId" column="primary_parent_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -87,7 +77,7 @@
|
||||
<result property="childNodeId" column="child_node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" class="java.util.HashMap">
|
||||
<resultMap id="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" type="java.util.HashMap">
|
||||
<result property="inheritedAclId" column="inherited_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="inheritedAclType" column="inherited_acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="aclId" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -98,11 +88,11 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_admNewContentProp" class="map">
|
||||
<parameterMap id="parameter_admNewContentProp" type="map">
|
||||
<parameter property="longValue" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="nodeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -110,24 +100,24 @@
|
||||
<parameter property="localeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_contentMimetype" class="map">
|
||||
<parameterMap id="parameter_contentMimetype" type="map">
|
||||
<parameter property="newMimetypeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="oldMimetypeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_childAssocCrcs" class="map">
|
||||
<parameterMap id="parameter_childAssocCrcs" type="map">
|
||||
<parameter property="childNodeNameCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="qnameCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_nodeTypeAndNamePattern" class="map">
|
||||
<parameterMap id="parameter_nodeTypeAndNamePattern" type="map">
|
||||
<parameter property="typeQNameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="propQNameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="namePattern" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_RenamedDuplicateEntry" class="DuplicateEntry">
|
||||
<parameterMap id="parameter_RenamedDuplicateEntry" type="DuplicateEntry">
|
||||
<parameter property="name" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
<parameter property="parentId" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
@@ -137,23 +127,23 @@
|
||||
<!-- Selects -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_avmMaxNodeId" resultClass="java.lang.Long">
|
||||
<select id="select_avmMaxNodeId" resultType="java.lang.Long">
|
||||
select max(id) from avm_nodes
|
||||
</select>
|
||||
|
||||
<select id="select_admMaxNodeId" resultClass="java.lang.Long">
|
||||
<select id="select_admMaxNodeId" resultType="java.lang.Long">
|
||||
select max(id) from alf_node
|
||||
</select>
|
||||
|
||||
<select id="select_avmNodesWithOldContentProperties" parameterClass="Ids" resultClass="java.lang.Long">
|
||||
<select id="select_avmNodesWithOldContentProperties" parameterType="Ids" resultType="java.lang.Long">
|
||||
<![CDATA[
|
||||
select
|
||||
id
|
||||
from
|
||||
avm_nodes
|
||||
where
|
||||
id >= #idOne#
|
||||
and id < #idTwo#
|
||||
id >= #{idOne}
|
||||
and id < #{idTwo}
|
||||
and class_type = 'plainfile'
|
||||
and content_url is not null
|
||||
and content_url not like 'id:%'
|
||||
@@ -162,7 +152,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_admOldContentProperties" parameterClass="Ids" resultMap="result_admOldContentProp">
|
||||
<select id="select_admOldContentProperties" parameterType="Ids" resultMap="result_admOldContentProp">
|
||||
<![CDATA[
|
||||
select
|
||||
node_id,
|
||||
@@ -173,8 +163,8 @@
|
||||
from
|
||||
alf_node_properties
|
||||
where
|
||||
node_id >= #idOne#
|
||||
and node_id < #idTwo#
|
||||
node_id >= #{idOne}
|
||||
and node_id < #{idTwo}
|
||||
and actual_type_n = 11
|
||||
order by
|
||||
node_id ASC
|
||||
@@ -189,15 +179,15 @@
|
||||
alf_authority
|
||||
</select>
|
||||
|
||||
<select id="select_allChildAssocsCount" resultClass="java.lang.Integer">
|
||||
<select id="select_allChildAssocsCount" resultType="java.lang.Integer">
|
||||
select count(*) from alf_child_assoc
|
||||
</select>
|
||||
|
||||
<select id="select_maxChildAssocId" resultClass="java.lang.Long">
|
||||
<select id="select_maxChildAssocId" resultType="java.lang.Long">
|
||||
select max(id) from alf_child_assoc
|
||||
</select>
|
||||
|
||||
<select id="select_allChildAssocsForCrcs" parameterClass="Ids" resultMap="result_childAssocsForCrc">
|
||||
<select id="select_allChildAssocsForCrcs" parameterType="Ids" resultMap="result_childAssocsForCrc">
|
||||
<![CDATA[
|
||||
select
|
||||
ca.id,
|
||||
@@ -211,10 +201,10 @@
|
||||
from
|
||||
alf_child_assoc ca
|
||||
join alf_node cn on (cn.id = ca.child_node_id)
|
||||
left join alf_node_properties cnp on (cnp.node_id = cn.id and cnp.qname_id = #idOne#)
|
||||
left join alf_node_properties cnp on (cnp.node_id = cn.id and cnp.qname_id = #{idOne})
|
||||
where
|
||||
ca.id >= #idTwo# and
|
||||
ca.id < #idThree#
|
||||
ca.id >= #{idTwo} and
|
||||
ca.id < #{idThree}
|
||||
order by
|
||||
ca.id ASC
|
||||
]]>
|
||||
@@ -231,9 +221,9 @@
|
||||
join alf_store s on (s.id = n.store_id)
|
||||
join alf_node_properties np on (np.node_id = n.id)
|
||||
where
|
||||
n.type_qname_id = #typeQNameId# and
|
||||
np.qname_id = #propQNameId# and
|
||||
np.string_value like #namePattern#
|
||||
n.type_qname_id = #{typeQNameId} and
|
||||
np.qname_id = #{propQNameId} and
|
||||
np.string_value like #{namePattern}
|
||||
</select>
|
||||
|
||||
<select id="select_oldAttrTenants" resultMap="result_admTenant">
|
||||
@@ -302,7 +292,7 @@
|
||||
ga.name = '.ChainingUserRegistrySynchronizer'
|
||||
</select>
|
||||
|
||||
<select id="select_oldAttrCustomNames" resultClass="string">
|
||||
<select id="select_oldAttrCustomNames" resultType="string">
|
||||
select
|
||||
ga.name as name
|
||||
from
|
||||
@@ -311,7 +301,7 @@
|
||||
name not in ('alfresco-tenants', '.href', '.avm_lock_table', '.PropertyBackedBeans', '.ChainingUserRegistrySynchronizer')
|
||||
</select>
|
||||
|
||||
<select id="select_AllAclIds" resultClass="long">
|
||||
<select id="select_AllAclIds" resultType="long">
|
||||
select
|
||||
id
|
||||
from
|
||||
@@ -319,7 +309,7 @@
|
||||
</select>
|
||||
|
||||
<!-- for patch -->
|
||||
<select id="select_UsedAclIds" resultClass="long">
|
||||
<select id="select_UsedAclIds" resultType="long">
|
||||
select acl_id from avm_nodes where acl_id is not null
|
||||
union select acl_id from avm_stores where acl_id is not null
|
||||
union select acl_id from alf_node where acl_id is not null
|
||||
@@ -327,7 +317,7 @@
|
||||
</select>
|
||||
|
||||
<!-- for patch -->
|
||||
<select id="select_MaxAclId" resultClass="long">
|
||||
<select id="select_MaxAclId" resultType="long">
|
||||
select
|
||||
max(acl.id)
|
||||
from
|
||||
@@ -335,7 +325,7 @@
|
||||
</select>
|
||||
|
||||
<!-- for patch -->
|
||||
<select id="select_DmNodeCount" resultClass="long">
|
||||
<select id="select_DmNodeCount" resultType="long">
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
@@ -343,7 +333,7 @@
|
||||
</select>
|
||||
|
||||
<!-- for patch -->
|
||||
<select id="select_DmNodeCountWherePermissionsHaveChanged" parameterMap="parameter_IdMap" resultClass="long">
|
||||
<select id="select_DmNodeCountWherePermissionsHaveChanged" parameterMap="parameter_IdMap" resultType="long">
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
@@ -377,7 +367,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterClass="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
@@ -389,9 +379,9 @@
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #trueOrFalse#
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #trueOrFalse# AND childAcl.type = 2
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse} AND childAcl.type = 2
|
||||
where
|
||||
(
|
||||
acl.id = childAcl.inherits_from
|
||||
@@ -407,7 +397,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_definingAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterClass="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<select id="select_definingAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
@@ -419,9 +409,9 @@
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #trueOrFalse#
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #trueOrFalse# AND childAcl.type = 1
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse} AND childAcl.type = 1
|
||||
where
|
||||
(
|
||||
acl.inherited_acl = childAcl.inherits_from
|
||||
@@ -437,7 +427,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_aclsThatInheritFromNonPrimaryParent" parameterClass="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<select id="select_aclsThatInheritFromNonPrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
@@ -449,9 +439,9 @@
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #trueOrFalse#
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #trueOrFalse#
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse}
|
||||
where
|
||||
(
|
||||
childAcl.id is not null
|
||||
@@ -462,7 +452,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_aclsThatInheritWithInheritanceUnset" parameterClass="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<select id="select_aclsThatInheritWithInheritanceUnset" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
@@ -474,7 +464,7 @@
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #trueOrFalse#
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #trueOrFalse#
|
||||
where
|
||||
@@ -486,7 +476,7 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" parameterClass="boolean" resultMap="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl">
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" parameterType="boolean" resultMap="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
inheritedAcl.id as inherited_acl_id,
|
||||
@@ -496,7 +486,7 @@
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_access_control_list inheritedAcl on inheritedAcl.inherits_from = acl.id AND inheritedAcl.inherits = #trueOrFalse# AND inheritedAcl.type = 1
|
||||
join alf_access_control_list inheritedAcl on inheritedAcl.inherits_from = acl.id AND inheritedAcl.inherits = #{trueOrFalse} AND inheritedAcl.type = 1
|
||||
where acl.id = inheritedAcl.inherits_from
|
||||
AND NOT EXISTS (
|
||||
select 1
|
||||
@@ -558,7 +548,7 @@
|
||||
and parent_id = ?
|
||||
</update>
|
||||
|
||||
<update id="update_CreateSizeCurrentProperty" parameterClass="SizeCurrentParams" >
|
||||
<update id="update_CreateSizeCurrentProperty" parameterType="SizeCurrentParams" >
|
||||
INSERT INTO alf_node_properties
|
||||
(
|
||||
node_id, actual_type_n, persisted_type_n,
|
||||
@@ -571,22 +561,22 @@
|
||||
qname_id, list_index, locale_id)
|
||||
SELECT
|
||||
n.id, 0, 0,
|
||||
#false#,
|
||||
#{false},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
#sizeCurrentQNameId#, -1, #defaultLocaleId#
|
||||
#{sizeCurrentQNameId}, -1, #{defaultLocaleId}
|
||||
FROM
|
||||
alf_node n
|
||||
WHERE
|
||||
n.type_qname_id = #personTypeQNameId#
|
||||
n.type_qname_id = #{personTypeQNameId}
|
||||
AND NOT EXISTS
|
||||
(
|
||||
SELECT 1 FROM alf_node_properties np
|
||||
WHERE np.node_id = n.id
|
||||
AND np.qname_id = #sizeCurrentQNameId#
|
||||
AND np.qname_id = #{sizeCurrentQNameId}
|
||||
)
|
||||
</update>
|
||||
|
||||
@@ -610,4 +600,4 @@
|
||||
delete from alf_attributes
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,29 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.permissions">
|
||||
<mapper namespace="alfresco.permissions">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Acl" type="org.alfresco.repo.domain.permissions.AclEntity"/>
|
||||
<typeAlias alias="AclMember" type="org.alfresco.repo.domain.permissions.AclMemberEntity"/>
|
||||
<typeAlias alias="AclChangeSet" type="org.alfresco.repo.domain.permissions.AclChangeSetEntity"/>
|
||||
<typeAlias alias="Ace" type="org.alfresco.repo.domain.permissions.AceEntity"/>
|
||||
<typeAlias alias="AceContext" type="org.alfresco.repo.domain.permissions.AceContextEntity"/>
|
||||
<typeAlias alias="Permission" type="org.alfresco.repo.domain.permissions.PermissionEntity"/>
|
||||
<typeAlias alias="Authority" type="org.alfresco.repo.domain.permissions.AuthorityEntity"/>
|
||||
<typeAlias alias="AuthorityAlias" type="org.alfresco.repo.domain.permissions.AuthorityAliasEntity"/>
|
||||
<!-- NOTE: MyBatis #224 - eg. Oracle -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_Acl" class="Acl">
|
||||
<resultMap id="result_Acl" type="Acl">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="aclId" column="acl_id" jdbcType="VARCHAR" javaType="string"/>
|
||||
@@ -31,37 +18,37 @@
|
||||
<result property="aclVersion" column="acl_version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="inherits" column="inherits" jdbcType="BIT" javaType="boolean"/>
|
||||
<result property="inheritsFrom" column="inherits_from" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="type" column="type" jdbcType="INT" javaType="int"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="inheritedAcl" column="inherited_acl" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="isVersioned" column="is_versioned" jdbcType="BIT" javaType="boolean"/>
|
||||
<result property="requiresVersion" column="requires_version" jdbcType="BIT" javaType="boolean"/>
|
||||
<result property="aclChangeSet" column="acl_change_set" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AclMember" class="AclMember">
|
||||
<resultMap id="result_AclMember" type="AclMember">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="aclId" column="acl_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="aceId" column="ace_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="pos" column="pos" jdbcType="INT" javaType="int"/>
|
||||
<result property="pos" column="pos" jdbcType="INTEGER" javaType="int"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AclChangeSet" class="AclChangeSet">
|
||||
<resultMap id="result_AclChangeSet" type="AclChangeSet">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Ace" class="Ace">
|
||||
<resultMap id="result_Ace" type="Ace">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="permissionId" column="permission_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="authorityId" column="authority_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="allowed" column="allowed" jdbcType="BIT" javaType="boolean"/>
|
||||
<result property="applies" column="applies" jdbcType="INT" javaType="int"/>
|
||||
<result property="applies" column="applies" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="contextId" column="context_id" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AceContext" class="AceContext">
|
||||
<resultMap id="result_AceContext" type="AceContext">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="classContext" column="class_context" jdbcType="VARCHAR" javaType="string"/>
|
||||
@@ -69,33 +56,33 @@
|
||||
<result property="kvpContext" column="kvp_context" jdbcType="VARCHAR" javaType="string"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Permission" class="Permission">
|
||||
<resultMap id="result_Permission" type="Permission">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="typeQnameId" column="type_qname_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="string"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Authority" class="Authority">
|
||||
<resultMap id="result_Authority" type="Authority">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="authority" column="authority" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="crc" column="crc" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AuthorityAlias" class="AuthorityAlias">
|
||||
<resultMap id="result_AuthorityAlias" type="AuthorityAlias">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="authId" column="auth_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="aliasId" column="alias_id" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_AceAndAuthority" class="HashMap">
|
||||
<resultMap id="result_AceAndAuthority" type="HashMap">
|
||||
<result property="allowed" column="allowed" jdbcType="BIT" javaType="boolean"/>
|
||||
<result property="applies" column="applies" jdbcType="INT" javaType="int"/>
|
||||
<result property="applies" column="applies" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="authority" column="authority" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="permissionId" column="permission_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="pos" column="pos" jdbcType="INT" javaType="int"/>
|
||||
<result property="pos" column="pos" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="aclmemId" column="aclmem_id" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
@@ -104,34 +91,34 @@
|
||||
<!-- -->
|
||||
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NameMap" class="map">
|
||||
<parameterMap id="parameter_NameMap" type="map">
|
||||
<parameter property="name" jdbcType="VARCHAR" javaType="string"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdNameMap" class="map">
|
||||
<parameterMap id="parameter_IdNameMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="name" jdbcType="VARCHAR" javaType="string"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdBoolMap" class="map">
|
||||
<parameterMap id="parameter_IdBoolMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="bool" jdbcType="BIT" javaType="boolean"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NameBoolMap" class="map">
|
||||
<parameterMap id="parameter_NameBoolMap" type="map">
|
||||
<parameter property="name" jdbcType="VARCHAR" javaType="string"/>
|
||||
<parameter property="bool" jdbcType="BIT" javaType="boolean"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_IdIdIntBoolMap" class="map">
|
||||
<parameterMap id="parameter_IdIdIntBoolMap" type="map">
|
||||
<parameter property="id1" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="id2" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="bool" jdbcType="BIT" javaType="boolean"/>
|
||||
<parameter property="int" jdbcType="INT" javaType="int"/>
|
||||
<parameter property="int" jdbcType="INTEGER" javaType="int"/>
|
||||
</parameterMap>
|
||||
|
||||
<!-- -->
|
||||
@@ -143,8 +130,8 @@
|
||||
(version, acl_id, latest, acl_version, inherits, inherits_from,
|
||||
type, inherited_acl, is_versioned, requires_version, acl_change_set)
|
||||
values
|
||||
(#version#, #aclId#, #latest#, #aclVersion#, #inherits#, #inheritsFrom#,
|
||||
#type#, #inheritedAcl#, #isVersioned#, #requiresVersion#, #aclChangeSet#)
|
||||
(#{version}, #{aclId}, #{latest}, #{aclVersion}, #{inherits}, #{inheritsFrom},
|
||||
#{type}, #{inheritedAcl}, #{isVersioned}, #{requiresVersion}, #{aclChangeSet})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Acl_Sequence">
|
||||
@@ -152,106 +139,106 @@
|
||||
(id, version, acl_id, latest, acl_version, inherits, inherits_from,
|
||||
type, inherited_acl, is_versioned, requires_version, acl_change_set)
|
||||
values
|
||||
(#id#, #version#, #aclId#, #latest#, #aclVersion#, #inherits#, #inheritsFrom#,
|
||||
#type#, #inheritedAcl#, #isVersioned#, #requiresVersion#, #aclChangeSet#)
|
||||
(#{id}, #{version}, #{aclId}, #{latest}, #{aclVersion}, #{inherits}, #{inheritsFrom},
|
||||
#{type}, #{inheritedAcl}, #{isVersioned}, #{requiresVersion}, #{aclChangeSet})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AclMember_AutoIncrement">
|
||||
insert into alf_acl_member
|
||||
(version, acl_id, ace_id, pos)
|
||||
values
|
||||
(#version#, #aclId#, #aceId#, #pos#)
|
||||
(#{version}, #{aclId}, #{aceId}, #{pos})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AclMember_Sequence">
|
||||
insert into alf_acl_member
|
||||
(id, version, acl_id, ace_id, pos)
|
||||
values
|
||||
(#id#, #version#, #aclId#, #aceId#, #pos#)
|
||||
(#{id}, #{version}, #{aclId}, #{aceId}, #{pos})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AclChangeSet_AutoIncrement">
|
||||
insert into alf_acl_change_set
|
||||
(version)
|
||||
values
|
||||
(#version#)
|
||||
(#{version})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AclChangeSet_Sequence">
|
||||
insert into alf_acl_change_set
|
||||
(id, version)
|
||||
values
|
||||
(#id#, #version#)
|
||||
(#{id}, #{version})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Ace_AutoIncrement">
|
||||
insert into alf_access_control_entry
|
||||
(version, permission_id, authority_id, allowed, applies, context_id)
|
||||
values
|
||||
(#version#, #permissionId#, #authorityId#, #allowed#, #applies#, #contextId#)
|
||||
(#{version}, #{permissionId}, #{authorityId}, #{allowed}, #{applies}, #{contextId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Ace_Sequence">
|
||||
insert into alf_access_control_entry
|
||||
(id, version, permission_id, authority_id, allowed, applies, context_id)
|
||||
values
|
||||
(#id#, #version#, #permissionId#, #authorityId#, #allowed#, #applies#, #contextId#)
|
||||
(#{id}, #{version}, #{permissionId}, #{authorityId}, #{allowed}, #{applies}, #{contextId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AceContext_AutoIncrement">
|
||||
insert into alf_ace_context
|
||||
(version, class_context, property_context, kvp_context)
|
||||
values
|
||||
(#version#, #classContext#, #propertyContext#, #kvpContext#)
|
||||
(#{version}, #{classContext}, #{propertyContext}, #{kvpContext})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AceContext_Sequence">
|
||||
insert into alf_ace_context
|
||||
(id, version, class_context, property_context, kvp_context)
|
||||
values
|
||||
(#id#, #version#, #classContext#, #propertyContext#, #kvpContext#)
|
||||
(#{id}, #{version}, #{classContext}, #{propertyContext}, #{kvpContext})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Permission_AutoIncrement">
|
||||
insert into alf_permission
|
||||
(version, type_qname_id, name)
|
||||
values
|
||||
(#version#, #typeQnameId#, #name#)
|
||||
(#{version}, #{typeQnameId}, #{name})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Permission_Sequence">
|
||||
insert into alf_permission
|
||||
(id, version, type_qname_id, name)
|
||||
values
|
||||
(#id#, #version#, #typeQnameId#, #name#)
|
||||
(#{id}, #{version}, #{typeQnameId}, #{name})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Authority_AutoIncrement">
|
||||
insert into alf_authority
|
||||
(version, authority, crc)
|
||||
values
|
||||
(#version#, #authority#, #crc#)
|
||||
(#{version}, #{authority}, #{crc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_Authority_Sequence">
|
||||
insert into alf_authority
|
||||
(id, version, authority, crc)
|
||||
values
|
||||
(#id#, #version#, #authority#, #crc#)
|
||||
(#{id}, #{version}, #{authority}, #{crc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuthorityAlias_AutoIncrement">
|
||||
insert into alf_authority_alias
|
||||
(version, auth_id, alias_id)
|
||||
values
|
||||
(#version#, #authId#, #aliasId#)
|
||||
(#{version}, #{authId}, #{aliasId})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_AuthorityAlias_Sequence">
|
||||
insert into alf_authority_alias
|
||||
(id, version, auth_id, alias_id)
|
||||
values
|
||||
(#id#, #version#, #authId#, #aliasId#)
|
||||
(#{id}, #{version}, #{authId}, #{aliasId})
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -259,73 +246,74 @@
|
||||
<!-- Updates -->
|
||||
<!-- -->
|
||||
|
||||
<!-- MyBatis #224 -->
|
||||
<!-- Optimistic update of the acl -->
|
||||
<update id="update_Acl" parameterClass="Acl">
|
||||
<update id="update_Acl" parameterType="Acl">
|
||||
update
|
||||
alf_access_control_list
|
||||
set
|
||||
acl_id = #aclId#,
|
||||
latest = #latest#,
|
||||
acl_version = #aclVersion#,
|
||||
inherits = #inherits#,
|
||||
inherits_from = #inheritsFrom#,
|
||||
type = #type#,
|
||||
inherited_acl = #inheritedAcl#,
|
||||
is_versioned = #isVersioned#,
|
||||
requires_version = #requiresVersion#,
|
||||
acl_change_set = #aclChangeSet#,
|
||||
version = #version#
|
||||
acl_id = #{aclId},
|
||||
latest = #{latest},
|
||||
acl_version = #{aclVersion},
|
||||
inherits = #{inherits},
|
||||
inherits_from = #{inheritsFrom,jdbcType=BIGINT},
|
||||
type = #{type},
|
||||
inherited_acl = #{inheritedAcl,jdbcType=BIGINT},
|
||||
is_versioned = #{isVersioned},
|
||||
requires_version = #{requiresVersion},
|
||||
acl_change_set = #{aclChangeSet,jdbcType=BIGINT},
|
||||
version = #{version}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Optimistic update of the acl member -->
|
||||
<update id="update_AclMember" parameterClass="AclMember">
|
||||
<update id="update_AclMember" parameterType="AclMember">
|
||||
update
|
||||
alf_acl_member
|
||||
set
|
||||
acl_id = #aclId#,
|
||||
ace_id = #aceId#,
|
||||
pos = #pos#,
|
||||
version = #version#
|
||||
acl_id = #{aclId},
|
||||
ace_id = #{aceId},
|
||||
pos = #{pos},
|
||||
version = #{version}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Optimistic update of the authority -->
|
||||
<update id="update_Authority" parameterClass="Authority">
|
||||
<update id="update_Authority" parameterType="Authority">
|
||||
update
|
||||
alf_authority
|
||||
set
|
||||
authority = #authority#,
|
||||
crc = #crc#,
|
||||
version = #version#
|
||||
authority = #{authority},
|
||||
crc = #{crc},
|
||||
version = #{version}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- Optimistic update of the permission -->
|
||||
<update id="update_Permission" parameterClass="Permission">
|
||||
<update id="update_Permission" parameterType="Permission">
|
||||
update
|
||||
alf_permission
|
||||
set
|
||||
type_qname_id = #typeQnameId#,
|
||||
name = #name#,
|
||||
version = #version#
|
||||
type_qname_id = #{typeQnameId},
|
||||
name = #{name},
|
||||
version = #{version}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- -->
|
||||
@@ -341,7 +329,7 @@
|
||||
id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AclsThatInheritFromAcl" parameterMap="parameter_IdBoolMap" resultClass="long">
|
||||
<select id="select_AclsThatInheritFromAcl" parameterMap="parameter_IdBoolMap" resultType="long">
|
||||
select
|
||||
acl.id
|
||||
from
|
||||
@@ -350,7 +338,7 @@
|
||||
acl.inherits_from = ? and acl.inherits = ?
|
||||
</select>
|
||||
|
||||
<select id="select_LatestAclByGuid" parameterMap="parameter_NameBoolMap" resultClass="long">
|
||||
<select id="select_LatestAclByGuid" parameterMap="parameter_NameBoolMap" resultType="long">
|
||||
select
|
||||
acl.id
|
||||
from
|
||||
@@ -359,7 +347,7 @@
|
||||
acl.acl_id = ? and acl.latest = ?
|
||||
</select>
|
||||
|
||||
<select id="select_ADMNodesByAclId" parameterMap="parameter_IdMap" resultClass="long">
|
||||
<select id="select_ADMNodesByAclId" parameterMap="parameter_IdMap" resultType="long">
|
||||
select
|
||||
id
|
||||
from
|
||||
@@ -368,7 +356,7 @@
|
||||
acl_id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_AVMNodesByAclId" parameterMap="parameter_IdMap" resultClass="long">
|
||||
<select id="select_AVMNodesByAclId" parameterMap="parameter_IdMap" resultType="long">
|
||||
select
|
||||
id
|
||||
from
|
||||
@@ -508,26 +496,26 @@
|
||||
</delete>
|
||||
|
||||
<!-- for patch -->
|
||||
<delete id="delete_AclList" parameterClass="list">
|
||||
<delete id="delete_AclList" parameterType="list">
|
||||
delete
|
||||
from
|
||||
alf_access_control_list
|
||||
where
|
||||
id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AcesList" parameterClass="list">
|
||||
<delete id="delete_AcesList" parameterType="list">
|
||||
delete
|
||||
from
|
||||
alf_access_control_entry
|
||||
where
|
||||
id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- for patch -->
|
||||
@@ -545,15 +533,15 @@
|
||||
)
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AclMembersList" parameterClass="list">
|
||||
<delete id="delete_AclMembersList" parameterType="list">
|
||||
delete
|
||||
from
|
||||
alf_acl_member
|
||||
where
|
||||
id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AclMembersByAclId" parameterMap="parameter_IdMap">
|
||||
@@ -565,15 +553,15 @@
|
||||
</delete>
|
||||
|
||||
<!-- for patch -->
|
||||
<delete id="delete_AclMembersForAclList" parameterClass="list">
|
||||
<delete id="delete_AclMembersForAclList" parameterType="list">
|
||||
delete
|
||||
from
|
||||
alf_acl_member
|
||||
where
|
||||
acl_id in
|
||||
<iterate open="(" close=")" conjunction=",">
|
||||
#[]#
|
||||
</iterate>
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delete_AclChangeSet" parameterMap="parameter_IdMap">
|
||||
@@ -616,4 +604,4 @@
|
||||
id = ?
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,40 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.propval">
|
||||
<mapper namespace="alfresco.propval">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="PropertyClass" type="org.alfresco.repo.domain.propval.PropertyClassEntity"/>
|
||||
<typeAlias alias="PropertyDateValue" type="org.alfresco.repo.domain.propval.PropertyDateValueEntity"/>
|
||||
<typeAlias alias="PropertyStringValue" type="org.alfresco.repo.domain.propval.PropertyStringValueEntity"/>
|
||||
<typeAlias alias="PropertyStringQuery" type="org.alfresco.repo.domain.propval.PropertyStringQueryEntity"/>
|
||||
<typeAlias alias="PropertyDoubleValue" type="org.alfresco.repo.domain.propval.PropertyDoubleValueEntity"/>
|
||||
<typeAlias alias="PropertySerializableValue" type="org.alfresco.repo.domain.propval.PropertySerializableValueEntity"/>
|
||||
<typeAlias alias="PropertyValue" type="org.alfresco.repo.domain.propval.PropertyValueEntity"/>
|
||||
<typeAlias alias="PropertyRoot" type="org.alfresco.repo.domain.propval.PropertyRootEntity"/>
|
||||
<typeAlias alias="PropertyLink" type="org.alfresco.repo.domain.propval.PropertyLinkEntity"/>
|
||||
<typeAlias alias="PropertyUniqueContext" type="org.alfresco.repo.domain.propval.PropertyUniqueContextEntity"/>
|
||||
<typeAlias alias="PropertyIdSearchRow" type="org.alfresco.repo.domain.propval.PropertyIdSearchRow"/>
|
||||
<typeAlias alias="PropertyIdQueryResult" type="org.alfresco.repo.domain.propval.PropertyIdQueryResult"/>
|
||||
<typeAlias alias="PropertyIdQueryParameter" type="org.alfresco.repo.domain.propval.PropertyIdQueryParameter"/>
|
||||
<!-- NOTE: MyBatis #224 - eg. Oracle -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_PropertyClass" class="PropertyClass">
|
||||
<resultMap id="result_PropertyClass" type="PropertyClass">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="javaClassName" column="java_class_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="javaClassNameShort" column="java_class_name_short" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="javaClassNameCrc" column="java_class_name_crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyDateValue" class="PropertyDateValue">
|
||||
<resultMap id="result_PropertyDateValue" type="PropertyDateValue">
|
||||
<!-- date_value is the PK as well -->
|
||||
<result property="dateValue" column="date_value" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="fullYear" column="full_year" jdbcType="SMALLINT" javaType="short"/>
|
||||
@@ -47,49 +29,49 @@
|
||||
<result property="dayOfMonth" column="day_of_month" jdbcType="TINYINT" javaType="short"/>
|
||||
<result property="dayOfWeek" column="day_of_week" jdbcType="TINYINT" javaType="short"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyStringValue" class="PropertyStringValue">
|
||||
<resultMap id="result_PropertyStringValue" type="PropertyStringValue">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="stringEndLower" column="string_end_lower" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="stringCrc" column="string_crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyDoubleValue" class="PropertyDoubleValue">
|
||||
<resultMap id="result_PropertyDoubleValue" type="PropertyDoubleValue">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="doubleValue" column="double_value" jdbcType="DOUBLE" javaType="java.lang.Double"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertySerializableValue" class="PropertySerializableValue">
|
||||
<resultMap id="result_PropertySerializableValue" type="PropertySerializableValue">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="serializableValue" column="serializable_value" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyValue_LocalOnly" class="PropertyValue">
|
||||
<resultMap id="result_PropertyValue_LocalOnly" type="PropertyValue">
|
||||
<result property="id" column="prop_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="actualTypeId" column="prop_actual_type_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="persistedType" column="prop_persisted_type" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
<result property="longValue" column="prop_long_value" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyValue_DoubleOnly" class="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<resultMap id="result_PropertyValue_DoubleOnly" type="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<result property="doubleValue" column="prop_double_value" jdbcType="DOUBLE" javaType="java.lang.Double"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyValue_StringOnly" class="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<resultMap id="result_PropertyValue_StringOnly" type="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<result property="stringValue" column="prop_string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyValue_All" class="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<resultMap id="result_PropertyValue_All" type="PropertyValue" extends="result_PropertyValue_LocalOnly">
|
||||
<result property="doubleValue" column="prop_double_value" jdbcType="DOUBLE" javaType="java.lang.Double"/>
|
||||
<result property="stringValue" column="prop_string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="serializableValue" column="prop_serializable_value" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyLink" class="PropertyLink">
|
||||
<resultMap id="result_PropertyLink" type="PropertyLink">
|
||||
<result property="rootPropId" column="link_root_prop_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="propIndex" column="link_prop_index" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="containedIn" column="link_contained_in" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="keyPropId" column="link_key_prop_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="valuePropId" column="link_value_prop_id" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyRoot" class="PropertyRoot">
|
||||
<resultMap id="result_PropertyRoot" type="PropertyRoot">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyUniqueContext" class="PropertyUniqueContext">
|
||||
<resultMap id="result_PropertyUniqueContext" type="PropertyUniqueContext">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
<result property="value1PropId" column="value1_prop_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -97,7 +79,7 @@
|
||||
<result property="value3PropId" column="value3_prop_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="propertyId" column="prop1_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyIdSearchRow" class="PropertyIdSearchRow">
|
||||
<resultMap id="result_PropertyIdSearchRow" type="PropertyIdSearchRow">
|
||||
<!-- If we use nested ResultMaps, then this ResultMap can't be embedded... -->
|
||||
<result property="rootPropId" column="link_root_prop_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="propIndex" column="link_prop_index" jdbcType="BIGINT" javaType="long"/>
|
||||
@@ -111,27 +93,27 @@
|
||||
<result property="stringValue" column="prop_string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="serializableValue" column="prop_serializable_value" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_PropertyIdQueryResult" class="PropertyIdQueryResult">
|
||||
<resultMap id="result_PropertyIdQueryResult" type="PropertyIdQueryResult">
|
||||
<result property="propId" column="prop_id" jdbcType="BIGINT" javaType="long"/>
|
||||
<result property="propValues" resultMap="alfresco.propval.result_PropertyIdSearchRow"/>
|
||||
<association property="propValues" resultMap="alfresco.propval.result_PropertyIdSearchRow"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- -->
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_PropertySerializableValue" class="PropertySerializableValue">
|
||||
<parameterMap id="parameter_PropertySerializableValue" type="PropertySerializableValue">
|
||||
<parameter property="serializableValue" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</parameterMap>
|
||||
<parameterMap id="parameter_IdPropertySerializableValue" class="PropertySerializableValue">
|
||||
<parameter property="id" jdbcType="java.lang.Long"/>
|
||||
<parameterMap id="parameter_IdPropertySerializableValue" type="PropertySerializableValue">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="serializableValue" jdbcType="BLOB" javaType="java.io.Serializable"/>
|
||||
</parameterMap>
|
||||
<parameterMap id="parameter_PropertyRoot" class="PropertyRoot">
|
||||
<parameterMap id="parameter_PropertyRoot" type="PropertyRoot">
|
||||
<parameter property="version" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
</parameterMap>
|
||||
<parameterMap id="parameter_IdPropertyRoot" class="PropertyRoot">
|
||||
<parameter property="id" jdbcType="java.lang.Long"/>
|
||||
<parameterMap id="parameter_IdPropertyRoot" type="PropertyRoot">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="version" jdbcType="TINYINT" javaType="java.lang.Short"/>
|
||||
</parameterMap>
|
||||
|
||||
@@ -141,17 +123,32 @@
|
||||
|
||||
<sql id="insert_PropertyClass_AutoIncrement">
|
||||
insert into alf_prop_class (java_class_name, java_class_name_short, java_class_name_crc)
|
||||
values (#javaClassName#, #javaClassNameShort#, #javaClassNameCrc#)
|
||||
values (#{javaClassName}, #{javaClassNameShort}, #{javaClassNameCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyClass_Sequence">
|
||||
insert into alf_prop_class (id, java_class_name, java_class_name_short, java_class_name_crc)
|
||||
values (#{id}, #{javaClassName}, #{javaClassNameShort}, #{javaClassNameCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyStringValue_AutoIncrement">
|
||||
insert into alf_prop_string_value (string_value, string_end_lower, string_crc)
|
||||
values (#stringValue#, #stringEndLower#, #stringCrc#)
|
||||
values (#{stringValue}, #{stringEndLower}, #{stringCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyStringValue_Sequence">
|
||||
insert into alf_prop_string_value (id, string_value, string_end_lower, string_crc)
|
||||
values (#{id}, #{stringValue}, #{stringEndLower}, #{stringCrc})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyDoubleValue_AutoIncrement">
|
||||
insert into alf_prop_double_value (double_value)
|
||||
values (#doubleValue#)
|
||||
values (#{doubleValue})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyDoubleValue_Sequence">
|
||||
insert into alf_prop_double_value (id, double_value)
|
||||
values (#{id}, #{doubleValue})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertySerializableValue_AutoIncrement">
|
||||
@@ -159,15 +156,26 @@
|
||||
values (?)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertySerializableValue_Sequence">
|
||||
insert into alf_prop_serializable_value (id, serializable_value)
|
||||
values (?, ?)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyValue_AutoIncrement">
|
||||
insert into alf_prop_value (actual_type_id, persisted_type, long_value)
|
||||
values (#actualTypeId#, #persistedType#, #longValue#)
|
||||
values (#{actualTypeId}, #{persistedType}, #{longValue})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyValue_Sequence">
|
||||
insert into alf_prop_value (id, actual_type_id, persisted_type, long_value)
|
||||
values (#{id}, #{actualTypeId}, #{persistedType}, #{longValue})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyRoot_AutoIncrement">
|
||||
insert into alf_prop_root (version)
|
||||
values (?)
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyRoot_Sequence">
|
||||
insert into alf_prop_root (id, version)
|
||||
values (?, ?)
|
||||
@@ -175,11 +183,12 @@
|
||||
|
||||
<sql id="insert_PropertyUniqueContext_AutoIncrement">
|
||||
insert into alf_prop_unique_ctx (version, value1_prop_id, value2_prop_id, value3_prop_id, prop1_id)
|
||||
values (#version#, #value1PropId#, #value2PropId#, #value3PropId#, #propertyId#)
|
||||
values (#{version}, #{value1PropId}, #{value2PropId}, #{value3PropId}, #{propertyId,jdbcType=BIGINT})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_PropertyUniqueContext_Sequence">
|
||||
insert into alf_prop_unique_ctx (id, version, value1_prop_id, value2_prop_id, value3_prop_id, prop1_id)
|
||||
values (#id#, #version#, #value1PropId#, #value2PropId#, #value3PropId#, #propertyId#)
|
||||
values (#{id}, #{version}, #{value1PropId}, #{value2PropId}, #{value3PropId}, #{propertyId,jdbcType=BIGINT})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
@@ -187,27 +196,27 @@
|
||||
<!-- -->
|
||||
|
||||
<!-- Get a property class by ID -->
|
||||
<select id="select_PropertyClassByID" parameterClass="PropertyClass" resultMap="result_PropertyClass">
|
||||
<select id="select_PropertyClassByID" parameterType="PropertyClass" resultMap="result_PropertyClass">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_class
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property class by class name -->
|
||||
<select id="select_PropertyClassByName" parameterClass="PropertyClass" resultMap="result_PropertyClass">
|
||||
<select id="select_PropertyClassByName" parameterType="PropertyClass" resultMap="result_PropertyClass">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_class
|
||||
where
|
||||
java_class_name_crc = #javaClassNameCrc# and
|
||||
java_class_name_short = #javaClassNameShort#
|
||||
java_class_name_crc = #{javaClassNameCrc} and
|
||||
java_class_name_short = #{javaClassNameShort}
|
||||
</select>
|
||||
|
||||
<insert id="insert_PropertyDateValue" parameterClass="PropertyDateValue" >
|
||||
<insert id="insert_PropertyDateValue" parameterType="PropertyDateValue" >
|
||||
insert into alf_prop_date_value
|
||||
(
|
||||
date_value,
|
||||
@@ -218,88 +227,88 @@
|
||||
)
|
||||
values
|
||||
(
|
||||
#dateValue#,
|
||||
#fullYear#, #halfOfYear#, #quarterOfYear#,
|
||||
#monthOfYear#,
|
||||
#weekOfYear#, #weekOfMonth#,
|
||||
#dayOfYear#, #dayOfMonth#, #dayOfWeek#
|
||||
#{dateValue},
|
||||
#{fullYear}, #{halfOfYear}, #{quarterOfYear},
|
||||
#{monthOfYear},
|
||||
#{weekOfYear}, #{weekOfMonth},
|
||||
#{dayOfYear}, #{dayOfMonth}, #{dayOfWeek}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- Get a property date value by ID -->
|
||||
<select id="select_PropertyDateValueByID" parameterClass="java.lang.Long" resultMap="result_PropertyDateValue">
|
||||
<select id="select_PropertyDateValueByID" parameterType="java.lang.Long" resultMap="result_PropertyDateValue">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_date_value
|
||||
where
|
||||
date_value = #dateValue#
|
||||
date_value = #{dateValue}
|
||||
</select>
|
||||
|
||||
<!-- Get the property date value by value -->
|
||||
<select id="select_PropertyDateValueByValue" parameterClass="java.lang.Long" resultMap="result_PropertyDateValue">
|
||||
<select id="select_PropertyDateValueByValue" parameterType="java.lang.Long" resultMap="result_PropertyDateValue">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_date_value
|
||||
where
|
||||
date_value = #dateValue#
|
||||
date_value = #{dateValue}
|
||||
</select>
|
||||
|
||||
<!-- Get a property string value by ID -->
|
||||
<select id="select_PropertyStringValueByID" parameterClass="PropertyStringValue" resultClass="string">
|
||||
<select id="select_PropertyStringValueByID" parameterType="PropertyStringValue" resultType="string">
|
||||
select
|
||||
string_value
|
||||
from
|
||||
alf_prop_string_value
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property string value by value
|
||||
-->
|
||||
<select id="select_PropertyStringValueByValue" parameterClass="PropertyStringValue" resultClass="java.lang.Long">
|
||||
<select id="select_PropertyStringValueByValue" parameterType="PropertyStringValue" resultType="java.lang.Long">
|
||||
select
|
||||
id
|
||||
from
|
||||
alf_prop_string_value
|
||||
where
|
||||
string_end_lower = #stringEndLower# and
|
||||
string_crc = #stringCrc#
|
||||
string_end_lower = #{stringEndLower} and
|
||||
string_crc = #{stringCrc}
|
||||
</select>
|
||||
|
||||
<!-- Get a property double value by ID -->
|
||||
<select id="select_PropertyDoubleValueByID" parameterClass="PropertyDoubleValue" resultMap="result_PropertyDoubleValue">
|
||||
<select id="select_PropertyDoubleValueByID" parameterType="PropertyDoubleValue" resultMap="result_PropertyDoubleValue">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_double_value
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property double value by value -->
|
||||
<select id="select_PropertyDoubleValueByValue" parameterClass="PropertyDoubleValue" resultMap="result_PropertyDoubleValue">
|
||||
<select id="select_PropertyDoubleValueByValue" parameterType="PropertyDoubleValue" resultMap="result_PropertyDoubleValue">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_double_value
|
||||
where
|
||||
double_value = #doubleValue#
|
||||
double_value = #{doubleValue}
|
||||
</select>
|
||||
|
||||
<!-- Get a property serializable value by ID -->
|
||||
<select id="select_PropertySerializableValueByID" parameterClass="PropertySerializableValue" resultMap="result_PropertySerializableValue">
|
||||
<select id="select_PropertySerializableValueByID" parameterType="PropertySerializableValue" resultMap="result_PropertySerializableValue">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_prop_serializable_value
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property value by value in alf_prop_value -->
|
||||
<select id="select_PropertyValueByLocalValue" parameterClass="PropertyValue" resultMap="result_PropertyValue_LocalOnly">
|
||||
<select id="select_PropertyValueByLocalValue" parameterType="PropertyValue" resultMap="result_PropertyValue_LocalOnly">
|
||||
select
|
||||
pv.id as prop_id,
|
||||
pv.actual_type_id as prop_actual_type_id,
|
||||
@@ -308,12 +317,12 @@
|
||||
from
|
||||
alf_prop_value pv
|
||||
where
|
||||
pv.actual_type_id = #actualTypeId# and
|
||||
pv.long_value = #longValue#
|
||||
pv.actual_type_id = #{actualTypeId} and
|
||||
pv.long_value = #{longValue}
|
||||
</select>
|
||||
|
||||
<!-- Get the property value by value in alf_prop_double_value -->
|
||||
<select id="select_PropertyValueByDoubleValue" parameterClass="PropertyValue" resultMap="result_PropertyValue_DoubleOnly">
|
||||
<select id="select_PropertyValueByDoubleValue" parameterType="PropertyValue" resultMap="result_PropertyValue_DoubleOnly">
|
||||
select
|
||||
pv.id as prop_id,
|
||||
pv.actual_type_id as prop_actual_type_id,
|
||||
@@ -322,14 +331,14 @@
|
||||
dv.double_value as prop_double_value
|
||||
from
|
||||
alf_prop_value pv
|
||||
join alf_prop_double_value dv on (dv.id = pv.long_value and pv.persisted_type = #persistedType#)
|
||||
join alf_prop_double_value dv on (dv.id = pv.long_value and pv.persisted_type = #{persistedType})
|
||||
where
|
||||
pv.actual_type_id = #actualTypeId# and
|
||||
dv.double_value = #doubleValue#
|
||||
pv.actual_type_id = #{actualTypeId} and
|
||||
dv.double_value = #{doubleValue}
|
||||
</select>
|
||||
|
||||
<!-- Get the property value by value in alf_prop_string_value -->
|
||||
<select id="select_PropertyValueByStringValue" parameterClass="PropertyStringQuery" resultMap="result_PropertyValue_StringOnly">
|
||||
<select id="select_PropertyValueByStringValue" parameterType="PropertyStringQuery" resultMap="result_PropertyValue_StringOnly">
|
||||
select
|
||||
pv.id as prop_id,
|
||||
pv.actual_type_id as prop_actual_type_id,
|
||||
@@ -338,15 +347,15 @@
|
||||
sv.string_value as prop_string_value
|
||||
from
|
||||
alf_prop_value pv
|
||||
join alf_prop_string_value sv on (sv.id = pv.long_value and pv.persisted_type = #persistedType#)
|
||||
join alf_prop_string_value sv on (sv.id = pv.long_value and pv.persisted_type = #{persistedType})
|
||||
where
|
||||
pv.actual_type_id = #actualTypeId# and
|
||||
sv.string_end_lower = #stringEndLower# and
|
||||
sv.string_crc = #stringCrc#
|
||||
pv.actual_type_id = #{actualTypeId} and
|
||||
sv.string_end_lower = #{stringEndLower} and
|
||||
sv.string_crc = #{stringCrc}
|
||||
</select>
|
||||
|
||||
<!-- Get the property value by ID -->
|
||||
<select id="select_PropertyValueById" parameterClass="PropertyValue" resultMap="result_PropertyValue_All">
|
||||
<select id="select_PropertyValueById" parameterType="PropertyValue" resultMap="result_PropertyValue_All">
|
||||
select
|
||||
pv.id as prop_id,
|
||||
pv.actual_type_id as prop_actual_type_id,
|
||||
@@ -361,11 +370,11 @@
|
||||
left join alf_prop_string_value sv on (sv.id = pv.long_value and (pv.persisted_type = 3 OR pv.persisted_type = 5 OR pv.persisted_type = 6))
|
||||
left join alf_prop_serializable_value serv on (serv.id = pv.long_value and pv.persisted_type = 4)
|
||||
where
|
||||
pv.id = #id#
|
||||
pv.id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property value by ID -->
|
||||
<select id="select_PropertyById" parameterClass="PropertyValue" resultMap="result_PropertyIdSearchRow">
|
||||
<select id="select_PropertyById" parameterType="PropertyValue" resultMap="result_PropertyIdSearchRow">
|
||||
select
|
||||
pl.root_prop_id as link_root_prop_id,
|
||||
pl.prop_index as link_prop_index,
|
||||
@@ -385,11 +394,11 @@
|
||||
left join alf_prop_string_value sv on (sv.id = pv.long_value and (pv.persisted_type = 3 OR pv.persisted_type = 5 OR pv.persisted_type = 6))
|
||||
left join alf_prop_serializable_value serv on (serv.id = pv.long_value and pv.persisted_type = 4)
|
||||
where
|
||||
pl.root_prop_id = #id#
|
||||
pl.root_prop_id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- Get the property values by a list of IDs -->
|
||||
<select id="select_PropertiesByIds" parameterClass="PropertyIdQueryParameter" resultMap="result_PropertyIdQueryResult">
|
||||
<select id="select_PropertiesByIds" parameterType="PropertyIdQueryParameter" resultMap="result_PropertyIdQueryResult">
|
||||
select
|
||||
pl.root_prop_id as prop_id,
|
||||
pl.root_prop_id as link_root_prop_id,
|
||||
@@ -409,63 +418,62 @@
|
||||
left join alf_prop_double_value dv on (dv.id = pv.long_value and pv.persisted_type = 2)
|
||||
left join alf_prop_string_value sv on (sv.id = pv.long_value and (pv.persisted_type = 3 OR pv.persisted_type = 5 OR pv.persisted_type = 6))
|
||||
left join alf_prop_serializable_value serv on (serv.id = pv.long_value and pv.persisted_type = 4)
|
||||
<dynamic prepend="where pl.root_prop_id in ">
|
||||
<iterate property="rootPropIds" open="(" close=")" conjunction=", ">
|
||||
#rootPropIds[]#
|
||||
</iterate>
|
||||
</dynamic>
|
||||
order by
|
||||
root_prop_id
|
||||
where pl.root_prop_id in
|
||||
<foreach item="item" index="index" collection="rootPropIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by
|
||||
root_prop_id
|
||||
</select>
|
||||
|
||||
<select id="select_PropertyRootById" parameterClass="PropertyRoot" resultMap="result_PropertyRoot">
|
||||
<select id="select_PropertyRootById" parameterType="PropertyRoot" resultMap="result_PropertyRoot">
|
||||
select
|
||||
id,
|
||||
version
|
||||
from
|
||||
alf_prop_root
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="update_PropertyRoot" parameterClass="PropertyRoot">
|
||||
<update id="update_PropertyRoot" parameterType="PropertyRoot">
|
||||
update
|
||||
alf_prop_root
|
||||
set
|
||||
version = #version#
|
||||
version = #{version}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="delete_PropertyRootById" parameterClass="PropertyRoot">
|
||||
<delete id="delete_PropertyRootById" parameterType="PropertyRoot">
|
||||
delete from
|
||||
alf_prop_root
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</delete>
|
||||
|
||||
<insert id="insert_PropertyLink" parameterClass="PropertyLink" >
|
||||
<insert id="insert_PropertyLink" parameterType="PropertyLink" >
|
||||
insert into alf_prop_link
|
||||
(
|
||||
root_prop_id, prop_index, contained_in, key_prop_id, value_prop_id
|
||||
)
|
||||
values
|
||||
(
|
||||
#rootPropId#, #propIndex#, #containedIn#, #keyPropId#, #valuePropId#
|
||||
#{rootPropId}, #{propIndex}, #{containedIn}, #{keyPropId}, #{valuePropId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="delete_PropertyLinksByRootId" parameterClass="PropertyRoot">
|
||||
<delete id="delete_PropertyLinksByRootId" parameterType="PropertyRoot">
|
||||
delete from
|
||||
alf_prop_link
|
||||
where
|
||||
root_prop_id = #id#
|
||||
root_prop_id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="select_PropertyUniqueContextById" parameterClass="PropertyUniqueContext" resultMap="result_PropertyUniqueContext">
|
||||
<select id="select_PropertyUniqueContextById" parameterType="PropertyUniqueContext" resultMap="result_PropertyUniqueContext">
|
||||
select
|
||||
id,
|
||||
version,
|
||||
@@ -476,10 +484,10 @@
|
||||
from
|
||||
alf_prop_unique_ctx
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="select_PropertyUniqueContextByValues" parameterClass="PropertyUniqueContext" resultMap="result_PropertyUniqueContext">
|
||||
<select id="select_PropertyUniqueContextByValues" parameterType="PropertyUniqueContext" resultMap="result_PropertyUniqueContext">
|
||||
select
|
||||
id,
|
||||
version,
|
||||
@@ -490,49 +498,49 @@
|
||||
from
|
||||
alf_prop_unique_ctx
|
||||
where
|
||||
value1_prop_id = #value1PropId#
|
||||
<isNotNull property="value2PropId">
|
||||
and value2_prop_id = #value2PropId#
|
||||
</isNotNull>
|
||||
<isNotNull property="value3PropId">
|
||||
and value3_prop_id = #value3PropId#
|
||||
</isNotNull>
|
||||
value1_prop_id = #{value1PropId}
|
||||
<if test="value2PropId != null">
|
||||
and value2_prop_id = #{value2PropId}
|
||||
</if>
|
||||
<if test="value3PropId != null">
|
||||
and value3_prop_id = #{value3PropId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="update_PropertyUniqueContext" parameterClass="PropertyUniqueContext">
|
||||
<update id="update_PropertyUniqueContext" parameterType="PropertyUniqueContext">
|
||||
update
|
||||
alf_prop_unique_ctx
|
||||
set
|
||||
version = #version#,
|
||||
value1_prop_id = #value1PropId#,
|
||||
value2_prop_id = #value2PropId#,
|
||||
value3_prop_id = #value3PropId#,
|
||||
prop1_id = #propertyId#
|
||||
version = #{version},
|
||||
value1_prop_id = #{value1PropId},
|
||||
value2_prop_id = #{value2PropId},
|
||||
value3_prop_id = #{value3PropId},
|
||||
prop1_id = #{propertyId,jdbcType=BIGINT}
|
||||
where
|
||||
id = #id#
|
||||
<isGreaterThan property="version" compareValue="0">
|
||||
and version = (#version#-1)
|
||||
</isGreaterThan>
|
||||
id = #{id}
|
||||
<if test="version gt 0">
|
||||
and version = (#{version} - 1)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="delete_PropertyUniqueContextById" parameterClass="PropertyUniqueContext">
|
||||
<delete id="delete_PropertyUniqueContextById" parameterType="PropertyUniqueContext">
|
||||
delete from
|
||||
alf_prop_unique_ctx
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delete_PropertyUniqueContextByValues" parameterClass="PropertyUniqueContext">
|
||||
<delete id="delete_PropertyUniqueContextByValues" parameterType="PropertyUniqueContext">
|
||||
delete from
|
||||
alf_prop_unique_ctx
|
||||
where
|
||||
value1_prop_id = #value1PropId#
|
||||
<isNotNull property="value2PropId">
|
||||
and value2_prop_id = #value2PropId#
|
||||
</isNotNull>
|
||||
<isNotNull property="value3PropId">
|
||||
and value3_prop_id = #value3PropId#
|
||||
</isNotNull>
|
||||
value1_prop_id = #{value1PropId}
|
||||
<if test="value2PropId != null">
|
||||
and value2_prop_id = #{value2PropId}
|
||||
</if>
|
||||
<if test="value3PropId != null">
|
||||
and value3_prop_id = #{value3PropId}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,29 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.qname">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Namespace" type="org.alfresco.repo.domain.qname.NamespaceEntity"/>
|
||||
<typeAlias alias="QName" type="org.alfresco.repo.domain.qname.QNameEntity"/>
|
||||
<mapper namespace="alfresco.qname">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_Namespace" class="Namespace">
|
||||
<resultMap id="result_Namespace" type="Namespace">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="uri" column="uri" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_QName" class="QName">
|
||||
<resultMap id="result_QName" type="QName">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="version" column="version" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="namespaceId" column="ns_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -34,15 +25,15 @@
|
||||
<!-- Parameter Maps -->
|
||||
<!-- -->
|
||||
|
||||
<parameterMap id="parameter_NamespaceId" class="Namespace">
|
||||
<parameterMap id="parameter_NamespaceId" type="Namespace">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NamespaceUri" class="Namespace">
|
||||
<parameterMap id="parameter_NamespaceUri" type="Namespace">
|
||||
<parameter property="uri" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_QNameId" class="QName">
|
||||
<parameterMap id="parameter_QNameId" type="QName">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
@@ -52,20 +43,20 @@
|
||||
|
||||
<sql id="insert_Namespace_AutoIncrement">
|
||||
insert into alf_namespace (version, uri)
|
||||
values (#version#, #uri#)
|
||||
values (#{version}, #{uri})
|
||||
</sql>
|
||||
<sql id="insert_Namespace_Sequence">
|
||||
insert into alf_namespace (id, version, uri)
|
||||
values (#id#, #version#, #uri#)
|
||||
values (#{id}, #{version}, #{uri})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_QName_AutoIncrement">
|
||||
insert into alf_qname (version, ns_id, local_name)
|
||||
values (#version#, #namespaceId#, #localName#)
|
||||
values (#{version}, #{namespaceId}, #{localName})
|
||||
</sql>
|
||||
<sql id="insert_QName_AutoIncrement_Sequence">
|
||||
insert into alf_qname (id, version, ns_id, local_name)
|
||||
values (#id#, #version#, #namespaceId#, #localName#)
|
||||
values (#{id}, #{version}, #{namespaceId}, #{localName})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
@@ -90,13 +81,13 @@
|
||||
uri = ?
|
||||
</select>
|
||||
|
||||
<update id="update_Namespace" parameterClass="Namespace">
|
||||
<update id="update_Namespace" parameterType="Namespace">
|
||||
update
|
||||
alf_namespace
|
||||
set
|
||||
uri = #uri#
|
||||
uri = #{uri}
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="select_QNameById" parameterMap="parameter_QNameId" resultMap="result_QName">
|
||||
@@ -108,24 +99,24 @@
|
||||
id = ?
|
||||
</select>
|
||||
|
||||
<select id="select_QNameByNsAndLocalName" parameterClass="QName" resultMap="result_QName">
|
||||
<select id="select_QNameByNsAndLocalName" parameterType="QName" resultMap="result_QName">
|
||||
select
|
||||
*
|
||||
from
|
||||
alf_qname
|
||||
where
|
||||
ns_id = #namespaceId# and
|
||||
local_name = #localName#
|
||||
ns_id = #{namespaceId} and
|
||||
local_name = #{localName}
|
||||
</select>
|
||||
|
||||
<update id="update_QName" parameterClass="QName">
|
||||
<update id="update_QName" parameterType="QName">
|
||||
update
|
||||
alf_qname
|
||||
set
|
||||
ns_id = #namespaceId#,
|
||||
local_name = #localName#
|
||||
ns_id = #{namespaceId},
|
||||
local_name = #{localName}
|
||||
where
|
||||
id = #id#
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,8 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<!--
|
||||
** This configuraton is for tests only. **
|
||||
@@ -27,29 +24,23 @@
|
||||
|
||||
See class CannedQueryDAOTest for a demonstration.
|
||||
-->
|
||||
<sqlMap namespace="alfresco.query.test">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="TestOne" type="org.alfresco.repo.domain.query.CannedQueryDAOTest$TestOneParams"/>
|
||||
<mapper namespace="alfresco.query.test">
|
||||
|
||||
<!-- -->
|
||||
<!-- Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_CountMimetypes" parameterClass="TestOne" resultClass="Long">
|
||||
<select id="select_CountMimetypes" parameterType="TestOne" resultType="Long">
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
alf_mimetype
|
||||
<isNotNull property="mimetypeMatch">
|
||||
<if test="mimetypeMatch != null">
|
||||
where
|
||||
<isEqual property="exact" compareValue="true">mimetype_str = #mimetypeMatch#</isEqual>
|
||||
<isEqual property="exact" compareValue="false">mimetype_str like #mimetypeMatch#</isEqual>
|
||||
</isNotNull>
|
||||
<isEqual property="forceFail" compareValue="true">JUNKED</isEqual>
|
||||
<if test="exact == true">mimetype_str = #{mimetypeMatch}</if>
|
||||
<if test="exact == false">mimetype_str like #{mimetypeMatch}</if>
|
||||
</if>
|
||||
<if test="forceFail == true">JUNKED</if>
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,40 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<!--
|
||||
Queries related to repository usages and restrictions.
|
||||
-->
|
||||
<sqlMap namespace="alfresco.query.usages">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
<mapper namespace="alfresco.query.usages">
|
||||
|
||||
<!-- -->
|
||||
<!-- Statements -->
|
||||
<!-- -->
|
||||
|
||||
<select id="select_CountPersonsNotDisabled" parameterClass="Ids" resultClass="Long">
|
||||
<select id="select_CountPersonsNotDisabled" parameterType="Ids" resultType="Long">
|
||||
<![CDATA[
|
||||
select count(*)
|
||||
from
|
||||
alf_node n
|
||||
left join alf_node_aspects na on (na.node_id = n.id and na.qname_id = #idOne#)
|
||||
left join alf_node_aspects na on (na.node_id = n.id and na.qname_id = #{idOne})
|
||||
where
|
||||
n.type_qname_id = #idTwo#
|
||||
n.type_qname_id = #{idTwo}
|
||||
and na.qname_id is null
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_CountDocuments" parameterClass="Ids" resultClass="Long">
|
||||
<select id="select_CountDocuments" parameterType="Ids" resultType="Long">
|
||||
select count(*) from alf_node n
|
||||
where n.type_qname_id in
|
||||
<iterate property="ids" open="(" close=")" conjunction=",">#ids[]#</iterate>
|
||||
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,30 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.solr">
|
||||
<mapper namespace="alfresco.solr">
|
||||
|
||||
<typeAlias alias="SOLRTransaction" type="org.alfresco.repo.domain.solr.TransactionEntity"/>
|
||||
<typeAlias alias="Node" type="org.alfresco.repo.domain.node.NodeEntity"/>
|
||||
<typeAlias alias="SOLRTransactionParameters" type="org.alfresco.repo.domain.solr.SOLRTransactionParameters"/>
|
||||
<typeAlias alias="NodeParameters" type="org.alfresco.repo.domain.solr.NodeParameters"/>
|
||||
|
||||
<resultMap id="result_Node" class="Node">
|
||||
<resultMap id="result_Node" type="Node">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="deleted" column="node_deleted" jdbcType="BIT" javaType="java.lang.Boolean" />
|
||||
<result property="transaction.id" column="txn_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="store.protocol" column="protocol" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="store.identifier" column="identifier" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="uuid" column="uuid" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_Transaction" class="SOLRTransaction">
|
||||
<resultMap id="result_Transaction" type="SOLRTransaction">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="commitTimeMs" column="commit_time_ms" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="updates" column="updates" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="deletes" column="deletes" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="updates" column="updates" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="deletes" column="deletes" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select_Txns" parameterClass="SOLRTransactionParameters" resultMap="result_Transaction">
|
||||
<select id="select_Txns" parameterType="SOLRTransactionParameters" resultMap="result_Transaction">
|
||||
select
|
||||
txn.id as id,
|
||||
txn.commit_time_ms as commit_time_ms,
|
||||
@@ -46,71 +42,86 @@
|
||||
) as deletes
|
||||
from
|
||||
alf_transaction txn
|
||||
<dynamic prepend="where">
|
||||
<isNotNull property="txnFromCommitTime" prepend="and">
|
||||
<![CDATA[txn.commit_time_ms >= #txnFromCommitTime#]]>
|
||||
</isNotNull>
|
||||
<isNotNull property="minTxnId" prepend="and">
|
||||
<![CDATA[txn.id >= #minTxnId#]]>
|
||||
</isNotNull>
|
||||
</dynamic>
|
||||
<where>
|
||||
<if test="txnFromCommitTime != null">
|
||||
<![CDATA[txn.commit_time_ms >= #{txnFromCommitTime}]]>
|
||||
</if>
|
||||
<if test="minTxnId != null">
|
||||
<![CDATA[and txn.id >= #{minTxnId}]]>
|
||||
</if>
|
||||
</where>
|
||||
order by txn.commit_time_ms ASC, txn.id ASC
|
||||
</select>
|
||||
|
||||
<select id="select_Txn_Nodes" parameterClass="NodeParameters" resultMap="result_Node">
|
||||
<select id="select_Txn_Nodes" parameterType="NodeParameters" resultMap="result_Node">
|
||||
select
|
||||
node.id as id,
|
||||
node.node_deleted as node_deleted,
|
||||
node.transaction_id as txn_id
|
||||
node.transaction_id as txn_id,
|
||||
node.uuid as uuid,
|
||||
store.protocol as protocol,
|
||||
store.identifier as identifier
|
||||
from
|
||||
alf_transaction txn
|
||||
join alf_node node on (txn.id = node.transaction_id)
|
||||
<dynamic>
|
||||
<isEqual property="storeFilter" compareValue="true">
|
||||
join alf_store store on (store.id = node.store_id)
|
||||
</isEqual>
|
||||
</dynamic>
|
||||
<dynamic prepend="where">
|
||||
<isNotNull property="transactionIds" prepend="and">
|
||||
txn.id in <iterate property="transactionIds" open="(" close=")" conjunction=", ">#transactionIds[]#</iterate>
|
||||
</isNotNull>
|
||||
<isNotNull property="fromNodeId" prepend="and">
|
||||
<![CDATA[node.id >= #fromNodeId#]]>
|
||||
</isNotNull>
|
||||
<isNotNull property="toNodeId" prepend="and">
|
||||
<![CDATA[node.id <= #toNodeId#]]>
|
||||
</isNotNull>
|
||||
<isNotNull property="storeProtocol" prepend="and">
|
||||
store.protocol = #storeProtocol#
|
||||
</isNotNull>
|
||||
<isNotNull property="storeIdentifier" prepend="and">
|
||||
store.identifier = #storeIdentifier#
|
||||
</isNotNull>
|
||||
<isNotNull property="includeTypeIds" prepend="and">
|
||||
node.type_qname_id in <iterate property="includeTypeIds" open="(" close=")" conjunction=", ">#includeTypeIds[]#</iterate>
|
||||
</isNotNull>
|
||||
<isNotNull property="excludeTypeIds" prepend="and">
|
||||
node.type_qname_id not in <iterate property="excludeTypeIds" open="(" close=")" conjunction=", ">#excludeTypeIds[]#</iterate>
|
||||
</isNotNull>
|
||||
<isNotNull property="includeAspectIds" prepend="and">
|
||||
exists (
|
||||
<where>
|
||||
<if test="transactionIds != null">
|
||||
txn.id in
|
||||
<foreach item="item" index="index" collection="transactionIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="fromNodeId != null">
|
||||
<![CDATA[and node.id >= #{fromNodeId}]]>
|
||||
</if>
|
||||
<if test="toNodeId != null">
|
||||
<![CDATA[and node.id <= #{toNodeId}]]>
|
||||
</if>
|
||||
<if test="storeProtocol != null">
|
||||
and store.protocol = #{storeProtocol}
|
||||
</if>
|
||||
<if test="storeIdentifier != null">
|
||||
and store.identifier = #{storeIdentifier}
|
||||
</if>
|
||||
<if test="includeTypeIds != null">
|
||||
and node.type_qname_id in
|
||||
<foreach item="item" index="index" collection="includeTypeIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="excludeTypeIds != null">
|
||||
and node.type_qname_id not in
|
||||
<foreach item="item" index="index" collection="excludeTypeIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="includeAspectIds != null">
|
||||
and exists (
|
||||
select *
|
||||
from alf_node_aspects aspects
|
||||
where
|
||||
aspects.node_id = node.id
|
||||
and aspects.qname_id in <iterate property="includeAspectIds" open="(" close=")" conjunction=", ">#includeAspectIds[]#</iterate>
|
||||
and aspects.qname_id in
|
||||
<foreach item="item" index="index" collection="includeAspectIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</isNotNull>
|
||||
<isNotNull property="excludeAspectIds" prepend="and">
|
||||
not exists (
|
||||
</if>
|
||||
<if test="excludeAspectIds != null">
|
||||
and not exists (
|
||||
select *
|
||||
from alf_node_aspects aspects
|
||||
where
|
||||
aspects.node_id = node.id
|
||||
and aspects.qname_id in <iterate property="excludeAspectIds" open="(" close=")" conjunction=", ">#excludeAspectIds[]#</iterate>
|
||||
and aspects.qname_id in
|
||||
<foreach item="item" index="index" collection="excludeAspectIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</isNotNull>
|
||||
</dynamic>
|
||||
</if>
|
||||
</where>
|
||||
order by node.id ASC
|
||||
</select>
|
||||
</sqlMap>
|
||||
|
||||
</mapper>
|
@@ -1,38 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.usage">
|
||||
|
||||
<!-- -->
|
||||
<!-- Type Defs -->
|
||||
<!-- -->
|
||||
|
||||
<typeAlias alias="UsageDelta" type="org.alfresco.repo.domain.usage.UsageDeltaEntity"/>
|
||||
<mapper namespace="alfresco.usage">
|
||||
|
||||
<!-- -->
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_UsageDelta" class="UsageDelta">
|
||||
<resultMap id="result_UsageDelta" type="UsageDelta">
|
||||
<result property="deltaCount" column="delta_count" jdbcType="INTEGER" javaType="int"/>
|
||||
<result property="deltaSize" column="delta_size" jdbcType="BIGINT" javaType="long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_UsernameUUID" class="HashMap">
|
||||
<resultMap id="result_UsernameUUID" type="HashMap">
|
||||
<result property="username" column="username" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="uuid" column="uuid" jdbcType="VARCHAR" javaType="string"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_UserContentUrl" class="HashMap">
|
||||
<resultMap id="result_UserContentUrl" type="HashMap">
|
||||
<result property="owner" column="owner" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="creator" column="creator" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="contentUrl" column="contentUrl" jdbcType="VARCHAR" javaType="string"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_UserContentSize" class="HashMap">
|
||||
<resultMap id="result_UserContentSize" type="HashMap">
|
||||
<result property="owner" column="owner" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="creator" column="creator" jdbcType="VARCHAR" javaType="string"/>
|
||||
<result property="contentSize" column="contentSize" jdbcType="BIGINT" javaType="long"/>
|
||||
@@ -43,11 +35,11 @@
|
||||
<!-- -->
|
||||
|
||||
|
||||
<parameterMap id="parameter_IdMap" class="map">
|
||||
<parameterMap id="parameter_IdMap" type="map">
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_Selector1Map" class="map">
|
||||
<parameterMap id="parameter_Selector1Map" type="map">
|
||||
<parameter property="personTypeQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="usernamePropQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="sizeCurrentPropQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
@@ -55,7 +47,7 @@
|
||||
<parameter property="storeIdentifier" jdbcType="VARCHAR" javaType="string"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_Selector2Map" class="map">
|
||||
<parameterMap id="parameter_Selector2Map" type="map">
|
||||
<parameter property="contentTypeQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="ownerPropQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="contentPropQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
@@ -63,7 +55,7 @@
|
||||
<parameter property="storeIdentifier" jdbcType="VARCHAR" javaType="string"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_Selector3Map" class="map">
|
||||
<parameterMap id="parameter_Selector3Map" type="map">
|
||||
<parameter property="personTypeQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="sizeCurrentPropQNameID" jdbcType="BIGINT" javaType="long"/>
|
||||
<parameter property="storeProtocol" jdbcType="VARCHAR" javaType="string"/>
|
||||
@@ -79,14 +71,14 @@
|
||||
insert into alf_usage_delta
|
||||
(version, node_id, delta_size)
|
||||
values
|
||||
(#version#, #nodeId#, #deltaSize#)
|
||||
(#{version}, #{nodeId}, #{deltaSize})
|
||||
</sql>
|
||||
|
||||
<sql id="insert_UsageDelta_Sequence">
|
||||
insert into alf_usage_delta
|
||||
(id, version, node_id, delta_size)
|
||||
values
|
||||
(#id#, #version#, #nodeId#, #deltaSize#)
|
||||
(#{id}, #{version}, #{nodeId}, #{deltaSize})
|
||||
</sql>
|
||||
|
||||
<!-- -->
|
||||
@@ -109,7 +101,7 @@
|
||||
</select>
|
||||
|
||||
<!-- Get nodes with usage deltas -->
|
||||
<select id="select_GetUsageDeltaNodes" resultClass="long">
|
||||
<select id="select_GetUsageDeltaNodes" resultType="long">
|
||||
select
|
||||
distinct(node_id)
|
||||
from
|
||||
@@ -182,4 +174,4 @@
|
||||
node_id = ?
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,30 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.audit">
|
||||
<mapper namespace="alfresco.audit.insert">
|
||||
|
||||
<insert id="insert_AuditModel" parameterClass="AuditModel" >
|
||||
<insert id="insert_AuditModel" parameterType="AuditModel" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AuditModel_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuditApplication" parameterClass="AuditApplication" >
|
||||
<insert id="insert_AuditApplication" parameterType="AuditApplication" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AuditApplication_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuditEntry" parameterClass="AuditEntry" >
|
||||
<insert id="insert_AuditEntry" parameterType="AuditEntry" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AuditEntry_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,37 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.avm">
|
||||
<mapper namespace="alfresco.avm.insert">
|
||||
|
||||
<insert id="insert_AVMStore" parameterClass="AVMStore">
|
||||
<insert id="insert_AVMStore" parameterType="AVMStore" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AVMStore_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMStoreProperty" parameterMap="parameter_StorePropertyPatternMap">
|
||||
<insert id="insert_AVMStoreProperty" parameterMap="parameter_StorePropertyPatternMap" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AVMStoreProperty_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMNode" parameterClass="AVMNode">
|
||||
<insert id="insert_AVMNode" parameterType="AVMNode" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AVMNode_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMVersionRoot" parameterClass="AVMVersionRoot">
|
||||
<insert id="insert_AVMVersionRoot" parameterType="AVMVersionRoot" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AVMVersionRoot_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,37 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.content">
|
||||
<mapper namespace="alfresco.content.insert">
|
||||
|
||||
<insert id="insert_Mimetype" parameterClass="Mimetype" >
|
||||
<insert id="insert_Mimetype" parameterType="Mimetype" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.content.insert_Mimetype_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Encoding" parameterClass="Encoding" >
|
||||
<insert id="insert_Encoding" parameterType="Encoding" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.content.insert_Encoding_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ContentUrl" parameterMap="parameter_ContentUrl" >
|
||||
<insert id="insert_ContentUrl" parameterMap="parameter_ContentUrl" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.content.insert_ContentUrl_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ContentData" parameterMap="parameter_ContentData" >
|
||||
<insert id="insert_ContentData" parameterMap="parameter_ContentData" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.content.insert_ContentData_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,16 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.locale">
|
||||
<mapper namespace="alfresco.locale.insert">
|
||||
|
||||
<insert id="insert_Locale" parameterClass="Locale">
|
||||
<insert id="insert_Locale" parameterType="Locale" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.locale.insert_Locale_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,23 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.lock">
|
||||
<mapper namespace="alfresco.lock.insert">
|
||||
|
||||
<insert id="insert_LockResource" parameterClass="LockResource" >
|
||||
<insert id="insert_LockResource" parameterType="LockResource" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_LockResource_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Lock" parameterClass="Lock" >
|
||||
<insert id="insert_Lock" parameterType="Lock" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_Lock_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,51 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.node">
|
||||
<mapper namespace="alfresco.node.insert">
|
||||
|
||||
<insert id="insert_Server" parameterClass="Server" >
|
||||
<insert id="insert_Server" parameterType="Server" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_Server_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Store" parameterClass="Store" >
|
||||
<insert id="insert_Store" parameterType="Store" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_Store_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Node" parameterClass="Node" >
|
||||
<insert id="insert_Node" parameterType="Node" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_Node_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Transaction" parameterClass="Transaction" >
|
||||
<insert id="insert_Transaction" parameterType="Transaction" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_Transaction_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_NodeAssoc" parameterClass="NodeAssoc" >
|
||||
<insert id="insert_NodeAssoc" parameterType="NodeAssoc" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_NodeAssoc_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ChildAssoc" parameterClass="ChildAssoc" >
|
||||
<insert id="insert_ChildAssoc" parameterType="ChildAssoc" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.node.insert_ChildAssoc_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,27 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.node">
|
||||
<mapper namespace="alfresco.node.update">
|
||||
|
||||
<!--
|
||||
MySQL does not allow the target table to be present in the subselect
|
||||
-->
|
||||
<update id="update_PrimaryChildrenSharedAcl" parameterClass="PrimaryChildrenAclUpdate">
|
||||
<update id="update_PrimaryChildrenSharedAcl" parameterType="PrimaryChildrenAclUpdate">
|
||||
update
|
||||
alf_child_assoc assoc
|
||||
join alf_node child on (child.id = assoc.child_node_id and assoc.is_primary = #isPrimary#)
|
||||
join alf_node child on (child.id = assoc.child_node_id and assoc.is_primary = #{isPrimary})
|
||||
set
|
||||
child.acl_id = #newSharedAclId#
|
||||
child.acl_id = #{newSharedAclId}
|
||||
where
|
||||
assoc.parent_node_id = #primaryParentNodeId#
|
||||
assoc.parent_node_id = #{primaryParentNodeId}
|
||||
and
|
||||
(
|
||||
child.acl_id is null
|
||||
<isNotNull property="optionalOldSharedAclIdInAdditionToNull"> OR child.acl_id = #optionalOldSharedAclIdInAdditionToNull#</isNotNull>
|
||||
<if test="optionalOldSharedAclIdInAdditionToNull != null"> OR child.acl_id = #{optionalOldSharedAclIdInAdditionToNull}</if>
|
||||
)
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,65 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.permissions">
|
||||
<mapper namespace="alfresco.permissions.insert">
|
||||
|
||||
<insert id="insert_Acl" parameterClass="Acl">
|
||||
<insert id="insert_Acl" parameterType="Acl" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_Acl_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AclMember" parameterClass="AclMember">
|
||||
<insert id="insert_AclMember" parameterType="AclMember" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AclMember_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AclChangeSet" parameterClass="AclChangeSet">
|
||||
<insert id="insert_AclChangeSet" parameterType="AclChangeSet" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AclChangeSet_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Ace" parameterClass="Ace">
|
||||
<insert id="insert_Ace" parameterType="Ace" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_Ace_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AceContext" parameterClass="AceContext">
|
||||
<insert id="insert_AceContext" parameterType="AceContext" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AceContext_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Permission" parameterClass="Permission">
|
||||
<insert id="insert_Permission" parameterType="Permission" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_Permission_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Authority" parameterClass="Authority">
|
||||
<insert id="insert_Authority" parameterType="Authority" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_Authority_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuthorityAlias" parameterClass="AuthorityAlias">
|
||||
<insert id="insert_AuthorityAlias" parameterType="AuthorityAlias" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_AuthorityAlias_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,58 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.propval">
|
||||
<mapper namespace="alfresco.propval.insert">
|
||||
|
||||
<insert id="insert_PropertyClass" parameterClass="PropertyClass" >
|
||||
<insert id="insert_PropertyClass" parameterType="PropertyClass" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyClass_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyStringValue" parameterClass="PropertyStringValue" >
|
||||
<insert id="insert_PropertyStringValue" parameterType="PropertyStringValue" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyStringValue_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyDoubleValue" parameterClass="PropertyDoubleValue" >
|
||||
<insert id="insert_PropertyDoubleValue" parameterType="PropertyDoubleValue" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyDoubleValue_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertySerializableValue" parameterMap="parameter_PropertySerializableValue" >
|
||||
<insert id="insert_PropertySerializableValue" parameterMap="parameter_PropertySerializableValue" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertySerializableValue_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyValue" parameterClass="PropertyValue" >
|
||||
<insert id="insert_PropertyValue" parameterType="PropertyValue" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyValue_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyRoot" parameterMap="parameter_PropertyRoot" >
|
||||
<insert id="insert_PropertyRoot" parameterMap="parameter_PropertyRoot" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyRoot_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyUniqueContext" parameterClass="PropertyUniqueContext" >
|
||||
<insert id="insert_PropertyUniqueContext" parameterType="PropertyUniqueContext" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_PropertyUniqueContext_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,23 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.qname">
|
||||
<mapper namespace="alfresco.qname.insert">
|
||||
|
||||
<insert id="insert_Namespace" parameterClass="Namespace" >
|
||||
<insert id="insert_Namespace" parameterType="Namespace" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.qname.insert_Namespace_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_QName" parameterClass="QName" >
|
||||
<insert id="insert_QName" parameterType="QName" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="alfresco.qname.insert_QName_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,16 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.usage">
|
||||
<mapper namespace="alfresco.usage.insert">
|
||||
|
||||
<insert id="insert_UsageDelta" parameterClass="UsageDelta">
|
||||
<insert id="insert_UsageDelta" parameterType="UsageDelta" useGeneratedKeys="true" keyProperty="id">
|
||||
<include refid="insert_UsageDelta_AutoIncrement"/>
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
KEY_COLUMN:GENERATED_KEY
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,14 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.activities">
|
||||
<mapper namespace="alfresco.activities.insert">
|
||||
|
||||
<insert id="insert_activity_feedcontrol" parameterClass="FeedControl">
|
||||
<insert id="insert_activity_feedcontrol" parameterType="FeedControl">
|
||||
|
||||
<selectKey keyProperty="id" resultClass="long">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE" >
|
||||
select nextVal('alf_activity_feed_control_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -16,9 +14,9 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_activity_feed" parameterClass="ActivityFeed">
|
||||
<insert id="insert_activity_feed" parameterType="ActivityFeed">
|
||||
|
||||
<selectKey keyProperty="id" resultClass="long">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE" >
|
||||
select nextVal('alf_activity_feed_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -26,9 +24,9 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_activity_post" parameterClass="ActivityPost">
|
||||
<insert id="insert_activity_post" parameterType="ActivityPost">
|
||||
|
||||
<selectKey keyProperty="id" resultClass="long">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE" >
|
||||
select nextVal('alf_activity_post_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -36,4 +34,4 @@
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,42 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.audit">
|
||||
<mapper namespace="alfresco.audit.insert">
|
||||
|
||||
<insert id="insert_AuditModel" parameterClass="AuditModel" >
|
||||
<insert id="insert_AuditModel" parameterType="AuditModel" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_audit_model_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_audit_model (id, content_data_id, content_crc)
|
||||
values (#id#, #contentDataId#, #contentCrc#)
|
||||
<include refid="insert_AuditModel_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuditApplication" parameterClass="AuditApplication" >
|
||||
<insert id="insert_AuditApplication" parameterType="AuditApplication" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_audit_app_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_audit_app (id, version, app_name_id, audit_model_id, disabled_paths_id)
|
||||
values (#id#, #version#, #applicationNameId#, #auditModelId#, #disabledPathsId#)
|
||||
<include refid="insert_AuditApplication_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuditEntry" parameterClass="AuditEntry" >
|
||||
<insert id="insert_AuditEntry" parameterType="AuditEntry" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_audit_entry_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_audit_entry (id, audit_app_id, audit_user_id, audit_time, audit_values_id)
|
||||
values (#id#, #auditApplicationId#, #auditUserId#, #auditTime#, #auditValuesId#)
|
||||
<include refid="insert_AuditEntry_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,14 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.avm">
|
||||
<mapper namespace="alfresco.avm.insert">
|
||||
|
||||
<insert id="insert_AVMStore" parameterClass="AVMStore">
|
||||
<insert id="insert_AVMStore" parameterType="AVMStore">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('avm_stores_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -18,7 +16,7 @@
|
||||
|
||||
<insert id="insert_AVMStoreProperty" parameterMap="parameter_IdStorePropertyPatternMap">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('avm_store_properties_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -26,9 +24,9 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMNode" parameterClass="AVMNode">
|
||||
<insert id="insert_AVMNode" parameterType="AVMNode">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('avm_nodes_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -36,9 +34,9 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AVMVersionRoot" parameterClass="AVMVersionRoot">
|
||||
<insert id="insert_AVMVersionRoot" parameterType="AVMVersionRoot">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('avm_version_roots_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -46,4 +44,4 @@
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,53 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.content">
|
||||
<mapper namespace="alfresco.content.insert">
|
||||
|
||||
<insert id="insert_Mimetype" parameterClass="Mimetype" >
|
||||
<insert id="insert_Mimetype" parameterType="Mimetype" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_mimetype_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_mimetype (id, version, mimetype_str)
|
||||
values (#id#, #version#, lower(#mimetype#))
|
||||
<include refid="alfresco.content.insert_Mimetype_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Encoding" parameterClass="Encoding" >
|
||||
<insert id="insert_Encoding" parameterType="Encoding" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_encoding_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_encoding (id, version, encoding_str)
|
||||
values (#id#, #version#, lower(#encoding#))
|
||||
<include refid="alfresco.content.insert_Encoding_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ContentUrl" parameterClass="ContentUrl" >
|
||||
<insert id="insert_ContentUrl" parameterType="ContentUrl" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_content_url_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_content_url (id, content_url, content_url_short, content_url_crc, content_size, orphan_time)
|
||||
values (#id#, #contentUrl#, #contentUrlShort#, #contentUrlCrc#, #size#, #orphanTime#)
|
||||
<include refid="alfresco.content.insert_ContentUrl_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ContentData" parameterClass="ContentData" >
|
||||
<insert id="insert_ContentData" parameterType="ContentData" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_content_data_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_content_data (id, version, content_url_id, content_mimetype_id, content_encoding_id, content_locale_id)
|
||||
values (#id#, #version#, #contentUrlId#, #mimetypeId#, #encodingId#, #localeId#)
|
||||
<include refid="alfresco.content.insert_ContentData_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,18 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.locale">
|
||||
<mapper namespace="alfresco.locale.insert">
|
||||
|
||||
<insert id="insert_Locale" parameterClass="Locale">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Locale" parameterType="Locale">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_locale_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_locale (id, version, locale_str)
|
||||
values (#id#, #version#, #localeStr#)
|
||||
<include refid="alfresco.locale.insert_Locale_Sequence"/>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,31 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.lock">
|
||||
<mapper namespace="alfresco.lock.insert">
|
||||
|
||||
<insert id="insert_LockResource" parameterClass="LockResource" >
|
||||
<insert id="insert_LockResource" parameterType="LockResource" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_lock_resource_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_lock_resource (id, version, qname_ns_id, qname_localname)
|
||||
values (#id#, #version#, #qnameNamespaceId#, lower(#qnameLocalName#))
|
||||
<include refid="insert_LockResource_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Lock" parameterClass="Lock" >
|
||||
<insert id="insert_Lock" parameterType="Lock" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_lock_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_lock (id, version, shared_resource_id, excl_resource_id, lock_token, start_time, expiry_time)
|
||||
values (#id#, #version#, #sharedResourceId#, #exclusiveResourceId#, lower(#lockToken#), #startTime#, #expiryTime#)
|
||||
<include refid="insert_Lock_Sequence"/>
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,53 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.node">
|
||||
<mapper namespace="alfresco.node.insert">
|
||||
|
||||
<insert id="insert_Server" parameterClass="Server" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Server" parameterType="Server" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_server_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.node.insert_Server_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Store" parameterClass="Store" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Store" parameterType="Store" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_store_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.node.insert_Store_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Node" parameterClass="Node" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Node" parameterType="Node" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_node_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.node.insert_Node_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Transaction" parameterClass="Transaction" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Transaction" parameterType="Transaction" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_transaction_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.node.insert_Transaction_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_NodeAssoc" parameterClass="NodeAssoc" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_NodeAssoc" parameterType="NodeAssoc" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_node_assoc_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.node.insert_NodeAssoc_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_ChildAssoc" parameterClass="ChildAssoc" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_ChildAssoc" parameterType="ChildAssoc" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_child_assoc_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -55,4 +53,4 @@
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.permissions">
|
||||
<mapper namespace="alfresco.permissions.insert">
|
||||
|
||||
<insert id="insert_Acl" parameterClass="Acl">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Acl" parameterType="Acl">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE">
|
||||
select nextVal('alf_access_control_list_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -15,8 +13,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AclMember" parameterClass="AclMember">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_AclMember" parameterType="AclMember">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE">
|
||||
select nextVal('alf_acl_member_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -24,8 +22,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AclChangeSet" parameterClass="AclChangeSet">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_AclChangeSet" parameterType="AclChangeSet">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_acl_change_set_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -33,8 +31,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Ace" parameterClass="Ace">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Ace" parameterType="Ace">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_access_control_entry_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -42,8 +40,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AceContext" parameterClass="AceContext">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_AceContext" parameterType="AceContext">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_ace_context_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -51,8 +49,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Permission" parameterClass="Permission">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Permission" parameterType="Permission">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_permission_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -60,8 +58,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_Authority" parameterClass="Authority">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Authority" parameterType="Authority">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_authority_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -69,8 +67,8 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insert_AuthorityAlias" parameterClass="AuthorityAlias">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_AuthorityAlias" parameterType="AuthorityAlias">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_authority_alias_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -78,4 +76,4 @@
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,77 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.propval">
|
||||
<mapper namespace="alfresco.propval.insert">
|
||||
|
||||
<insert id="insert_PropertyClass" parameterClass="PropertyClass" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_PropertyClass" parameterType="PropertyClass" >
|
||||
<selectKey resultType=
|
||||
"long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_class_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_prop_class (id, java_class_name, java_class_name_short, java_class_name_crc)
|
||||
values (#id#, #javaClassName#, #javaClassNameShort#, #javaClassNameCrc#)
|
||||
<include refid="insert_PropertyClass_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyStringValue" parameterClass="PropertyStringValue" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_PropertyStringValue" parameterType="PropertyStringValue" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_string_value_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_prop_string_value (id, string_value, string_end_lower, string_crc)
|
||||
values (#id#, #stringValue#, #stringEndLower#, #stringCrc#)
|
||||
|
||||
<include refid="insert_PropertyStringValue_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyDoubleValue" parameterClass="PropertyDoubleValue" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_PropertyDoubleValue" parameterType="PropertyDoubleValue" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_double_value_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_prop_double_value (id, double_value)
|
||||
values (#id#, #doubleValue#)
|
||||
|
||||
<include refid="insert_PropertyDoubleValue_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertySerializableValue" parameterMap="parameter_IdPropertySerializableValue" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_serializable_value_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_prop_serializable_value (id, serializable_value)
|
||||
values (?, ?)
|
||||
|
||||
<include refid="insert_PropertySerializableValue_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyValue" parameterClass="PropertyValue" >
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_PropertyValue" parameterType="PropertyValue" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_value_seq')
|
||||
</selectKey>
|
||||
|
||||
insert into alf_prop_value (id, actual_type_id, persisted_type, long_value)
|
||||
values (#id#, #actualTypeId#, #persistedType#, #longValue#)
|
||||
|
||||
<include refid="insert_PropertyValue_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyRoot" parameterMap="parameter_IdPropertyRoot" >
|
||||
<selectKey resultClass="long" keyProperty="id" type="pre">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_root_seq')
|
||||
</selectKey>
|
||||
<include refid="insert_PropertyRoot_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_PropertyUniqueContext" parameterClass="PropertyUniqueContext" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_PropertyUniqueContext" parameterType="PropertyUniqueContext" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_prop_unique_ctx_seq')
|
||||
</selectKey>
|
||||
<include refid="insert_PropertyUniqueContext_Sequence"/>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,21 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.qname">
|
||||
<mapper namespace="alfresco.qname.insert">
|
||||
|
||||
<insert id="insert_Namespace" parameterClass="Namespace" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_Namespace" parameterType="Namespace" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_namespace_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="alfresco.qname.insert_Namespace_Sequence"/>
|
||||
</insert>
|
||||
|
||||
<insert id="insert_QName" parameterClass="QName" >
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_QName" parameterType="QName" >
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_qname_seq')
|
||||
</selectKey>
|
||||
|
||||
@@ -23,4 +21,4 @@
|
||||
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
@@ -1,17 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<sqlMap namespace="alfresco.usage">
|
||||
<mapper namespace="alfresco.usage.insert">
|
||||
|
||||
<insert id="insert_UsageDelta" parameterClass="UsageDelta">
|
||||
<selectKey resultClass="long" keyProperty="id">
|
||||
<insert id="insert_UsageDelta" parameterType="UsageDelta">
|
||||
<selectKey resultType="long" keyProperty="id" order="BEFORE" >
|
||||
select nextVal('alf_usage_delta_seq')
|
||||
</selectKey>
|
||||
|
||||
<include refid="insert_UsageDelta_Sequence"/>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
||||
</mapper>
|
163
config/alfresco/ibatis/repo-SqlMapConfig.xml
Normal file
163
config/alfresco/ibatis/repo-SqlMapConfig.xml
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
|
||||
<configuration>
|
||||
|
||||
<typeAliases>
|
||||
|
||||
<!-- AppliedPatch -->
|
||||
|
||||
<typeAlias alias="AppliedPatch" type="org.alfresco.repo.domain.patch.AppliedPatchEntity"/>
|
||||
|
||||
<!-- Audit -->
|
||||
<typeAlias alias="AuditModel" type="org.alfresco.repo.domain.audit.AuditModelEntity"/>
|
||||
<typeAlias alias="AuditApplication" type="org.alfresco.repo.domain.audit.AuditApplicationEntity"/>
|
||||
<typeAlias alias="AuditEntry" type="org.alfresco.repo.domain.audit.AuditEntryEntity"/>
|
||||
<typeAlias alias="AuditDeleteParameters" type="org.alfresco.repo.domain.audit.AuditDeleteParameters"/>
|
||||
<typeAlias alias="AuditQueryParameters" type="org.alfresco.repo.domain.audit.AuditQueryParameters"/>
|
||||
<typeAlias alias="AuditQueryResult" type="org.alfresco.repo.domain.audit.AuditQueryResult"/>
|
||||
|
||||
<!-- Content -->
|
||||
|
||||
<typeAlias alias="Mimetype" type="org.alfresco.repo.domain.mimetype.MimetypeEntity"/>
|
||||
<typeAlias alias="Encoding" type="org.alfresco.repo.domain.encoding.EncodingEntity"/>
|
||||
<typeAlias alias="ContentUrl" type="org.alfresco.repo.domain.contentdata.ContentUrlEntity"/>
|
||||
<typeAlias alias="ContentUrlUpdate" type="org.alfresco.repo.domain.contentdata.ContentUrlUpdateEntity"/>
|
||||
<typeAlias alias="ContentData" type="org.alfresco.repo.domain.contentdata.ContentDataEntity"/>
|
||||
<typeAlias alias="ContentUrlOrphanQuery" type="org.alfresco.repo.domain.contentdata.ContentUrlOrphanQuery"/>
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
|
||||
<!-- Locale -->
|
||||
|
||||
<typeAlias alias="Locale" type="org.alfresco.repo.domain.locale.LocaleEntity"/>
|
||||
|
||||
<!-- Locks -->
|
||||
|
||||
<typeAlias alias="LockResource" type="org.alfresco.repo.domain.locks.LockResourceEntity"/>
|
||||
<typeAlias alias="Lock" type="org.alfresco.repo.domain.locks.LockEntity"/>
|
||||
|
||||
<!-- Node -->
|
||||
|
||||
<typeAlias alias="Server" type="org.alfresco.repo.domain.node.ServerEntity"/>
|
||||
<typeAlias alias="Transaction" type="org.alfresco.repo.domain.node.TransactionEntity"/>
|
||||
<typeAlias alias="TransactionQuery" type="org.alfresco.repo.domain.node.TransactionQueryEntity"/>
|
||||
<typeAlias alias="Store" type="org.alfresco.repo.domain.node.StoreEntity"/>
|
||||
<typeAlias alias="Node" type="org.alfresco.repo.domain.node.NodeEntity"/>
|
||||
<typeAlias alias="NodeBatchLoad" type="org.alfresco.repo.domain.node.ibatis.NodeBatchLoadEntity"/>
|
||||
<typeAlias alias="NodeUpdate" type="org.alfresco.repo.domain.node.NodeUpdateEntity"/>
|
||||
<typeAlias alias="AuditProps" type="org.alfresco.repo.domain.node.AuditablePropertiesEntity"/>
|
||||
<typeAlias alias="NodePropertyKey" type="org.alfresco.repo.domain.node.NodePropertyKey"/>
|
||||
<typeAlias alias="NodePropertyValue" type="org.alfresco.repo.domain.node.NodePropertyValue"/>
|
||||
<typeAlias alias="NodeProperty" type="org.alfresco.repo.domain.node.NodePropertyEntity"/>
|
||||
<typeAlias alias="NodeAspects" type="org.alfresco.repo.domain.node.NodeAspectsEntity"/>
|
||||
<typeAlias alias="NodeAssoc" type="org.alfresco.repo.domain.node.NodeAssocEntity"/>
|
||||
<typeAlias alias="ChildAssoc" type="org.alfresco.repo.domain.node.ChildAssocEntity"/>
|
||||
<typeAlias alias="ChildProperty" type="org.alfresco.repo.domain.node.ChildPropertyEntity"/>
|
||||
<typeAlias alias="PrimaryChildrenAclUpdate" type="org.alfresco.repo.domain.node.PrimaryChildrenAclUpdateEntity"/>
|
||||
|
||||
<!-- Patch -->
|
||||
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
<typeAlias alias="DuplicateEntry" type="org.alfresco.repo.admin.patch.impl.DuplicateEntry" />
|
||||
<typeAlias alias="SizeCurrentParams" type="org.alfresco.repo.domain.patch.ibatis.SizeCurrentParams"/>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
||||
<typeAlias alias="Acl" type="org.alfresco.repo.domain.permissions.AclEntity"/>
|
||||
<typeAlias alias="AclMember" type="org.alfresco.repo.domain.permissions.AclMemberEntity"/>
|
||||
<typeAlias alias="AclChangeSet" type="org.alfresco.repo.domain.permissions.AclChangeSetEntity"/>
|
||||
<typeAlias alias="Ace" type="org.alfresco.repo.domain.permissions.AceEntity"/>
|
||||
<typeAlias alias="AceContext" type="org.alfresco.repo.domain.permissions.AceContextEntity"/>
|
||||
<typeAlias alias="Permission" type="org.alfresco.repo.domain.permissions.PermissionEntity"/>
|
||||
<typeAlias alias="Authority" type="org.alfresco.repo.domain.permissions.AuthorityEntity"/>
|
||||
<typeAlias alias="AuthorityAlias" type="org.alfresco.repo.domain.permissions.AuthorityAliasEntity"/>
|
||||
|
||||
<!-- PropVal -->
|
||||
|
||||
<typeAlias alias="PropertyClass" type="org.alfresco.repo.domain.propval.PropertyClassEntity"/>
|
||||
<typeAlias alias="PropertyDateValue" type="org.alfresco.repo.domain.propval.PropertyDateValueEntity"/>
|
||||
<typeAlias alias="PropertyStringValue" type="org.alfresco.repo.domain.propval.PropertyStringValueEntity"/>
|
||||
<typeAlias alias="PropertyStringQuery" type="org.alfresco.repo.domain.propval.PropertyStringQueryEntity"/>
|
||||
<typeAlias alias="PropertyDoubleValue" type="org.alfresco.repo.domain.propval.PropertyDoubleValueEntity"/>
|
||||
<typeAlias alias="PropertySerializableValue" type="org.alfresco.repo.domain.propval.PropertySerializableValueEntity"/>
|
||||
<typeAlias alias="PropertyValue" type="org.alfresco.repo.domain.propval.PropertyValueEntity"/>
|
||||
<typeAlias alias="PropertyRoot" type="org.alfresco.repo.domain.propval.PropertyRootEntity"/>
|
||||
<typeAlias alias="PropertyLink" type="org.alfresco.repo.domain.propval.PropertyLinkEntity"/>
|
||||
<typeAlias alias="PropertyUniqueContext" type="org.alfresco.repo.domain.propval.PropertyUniqueContextEntity"/>
|
||||
<typeAlias alias="PropertyIdSearchRow" type="org.alfresco.repo.domain.propval.PropertyIdSearchRow"/>
|
||||
<typeAlias alias="PropertyIdQueryResult" type="org.alfresco.repo.domain.propval.PropertyIdQueryResult"/>
|
||||
<typeAlias alias="PropertyIdQueryParameter" type="org.alfresco.repo.domain.propval.PropertyIdQueryParameter"/>
|
||||
|
||||
<!-- QName -->
|
||||
|
||||
<typeAlias alias="Namespace" type="org.alfresco.repo.domain.qname.NamespaceEntity"/>
|
||||
<typeAlias alias="QName" type="org.alfresco.repo.domain.qname.QNameEntity"/>
|
||||
|
||||
<!-- SOLR -->
|
||||
|
||||
<typeAlias alias="SOLRTransaction" type="org.alfresco.repo.domain.solr.TransactionEntity"/>
|
||||
<typeAlias alias="Node" type="org.alfresco.repo.domain.node.NodeEntity"/>
|
||||
<typeAlias alias="SOLRTransactionParameters" type="org.alfresco.repo.domain.solr.SOLRTransactionParameters"/>
|
||||
<typeAlias alias="NodeParameters" type="org.alfresco.repo.domain.solr.NodeParameters"/>
|
||||
|
||||
<!-- Usage -->
|
||||
|
||||
<typeAlias alias="UsageDelta" type="org.alfresco.repo.domain.usage.UsageDeltaEntity"/>
|
||||
|
||||
<!-- AVM -->
|
||||
|
||||
<typeAlias alias="AVMStore" type="org.alfresco.repo.domain.avm.AVMStoreEntity"/>
|
||||
<typeAlias alias="AVMNode" type="org.alfresco.repo.domain.avm.AVMNodeEntity"/>
|
||||
<typeAlias alias="AVMNodeAspect" type="org.alfresco.repo.domain.avm.AVMAspectEntity"/>
|
||||
<typeAlias alias="AVMChildEntry" type="org.alfresco.repo.domain.avm.AVMChildEntryEntity"/>
|
||||
<typeAlias alias="AVMVersionRoot" type="org.alfresco.repo.domain.avm.AVMVersionRootEntity"/>
|
||||
<typeAlias alias="AVMHistoryLink" type="org.alfresco.repo.domain.avm.AVMHistoryLinkEntity"/>
|
||||
<typeAlias alias="AVMMergeLink" type="org.alfresco.repo.domain.avm.AVMMergeLinkEntity"/>
|
||||
<typeAlias alias="AVMVersionLayeredNodeEntry" type="org.alfresco.repo.domain.avm.AVMVersionLayeredNodeEntryEntity"/>
|
||||
<typeAlias alias="AVMStoreProperty" type="org.alfresco.repo.domain.avm.AVMStorePropertyEntity"/>
|
||||
<typeAlias alias="AVMNodeProperty" type="org.alfresco.repo.domain.avm.AVMNodePropertyEntity"/>
|
||||
<typeAlias alias="IdListOfIdsParam" type="org.alfresco.repo.domain.patch.ibatis.IdListOfIdsParam"/>
|
||||
|
||||
<!-- Canned Queries -->
|
||||
|
||||
<typeAlias alias="TestOne" type="org.alfresco.repo.domain.query.CannedQueryDAOTest$TestOneParams"/>
|
||||
<typeAlias alias="Ids" type="org.alfresco.ibatis.IdsEntity"/>
|
||||
|
||||
</typeAliases>
|
||||
|
||||
<typeHandlers>
|
||||
<typeHandler javaType="java.io.Serializable" jdbcType="BLOB" handler="org.alfresco.ibatis.SerializableTypeHandler"/>
|
||||
</typeHandlers>
|
||||
|
||||
<mappers>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/appliedpatch-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/audit-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/audit-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/qname-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/locale-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/locale-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/locks-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/locks-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/content-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/content-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/node-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/node-update-acl-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/node-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/patch-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/permissions-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/permissions-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/propval-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/propval-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/solr-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/usage-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/usage-insert-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/avm-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/avm-insert-SqlMap.xml"/>
|
||||
<!-- Canned queries -->
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/query-test-common-SqlMap.xml"/>
|
||||
<mapper resource="alfresco/ibatis/#resource.dialect#/query-usages-common-SqlMap.xml"/>
|
||||
</mappers>
|
||||
|
||||
</configuration>
|
@@ -28,10 +28,10 @@ import org.alfresco.service.cmr.attributes.AttributeService;
|
||||
import org.alfresco.wcm.util.WCMUtil;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
/**
|
||||
* Migrate AVM lock attributes (from 'alf_*attribute*' to 'alf_prop_*')
|
||||
*
|
||||
@@ -62,7 +62,7 @@ public class MigrateAttrAVMLocksPatch extends AbstractPatch
|
||||
{
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
AVMLockRowHandler handler = new AVMLockRowHandler();
|
||||
AVMLockResultHandler handler = new AVMLockResultHandler();
|
||||
patchDAO.migrateOldAttrAVMLocks(handler);
|
||||
|
||||
if (handler.total > 0)
|
||||
@@ -79,17 +79,17 @@ public class MigrateAttrAVMLocksPatch extends AbstractPatch
|
||||
/**
|
||||
* Row handler for migrating AVM Locks
|
||||
*/
|
||||
private class AVMLockRowHandler implements RowHandler
|
||||
private class AVMLockResultHandler implements ResultHandler
|
||||
{
|
||||
private int total = 0;
|
||||
|
||||
private AVMLockRowHandler()
|
||||
private AVMLockResultHandler()
|
||||
{
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> result = (Map<String, Object>)valueObject;
|
||||
Map<String, Object> result = (Map<String, Object>)context.getResultObject();
|
||||
|
||||
String wpStoreId = (String)result.get("wpStoreId");
|
||||
String path = (String)result.get("relPath");
|
||||
|
@@ -26,10 +26,10 @@ import org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer;
|
||||
import org.alfresco.service.cmr.attributes.AttributeService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
/**
|
||||
* Migrate Chaining User Registry Synchronizer attributes (from 'alf_*attribute*' to 'alf_prop_*')
|
||||
*
|
||||
@@ -60,7 +60,7 @@ public class MigrateAttrChainingURSPatch extends AbstractPatch
|
||||
{
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
ChainingURSRowHandler handler = new ChainingURSRowHandler();
|
||||
ChainingURSResultHandler handler = new ChainingURSResultHandler();
|
||||
patchDAO.migrateOldAttrChainingURS(handler);
|
||||
|
||||
if (handler.total > 0)
|
||||
@@ -74,17 +74,17 @@ public class MigrateAttrChainingURSPatch extends AbstractPatch
|
||||
return msg;
|
||||
}
|
||||
|
||||
private class ChainingURSRowHandler implements RowHandler
|
||||
private class ChainingURSResultHandler implements ResultHandler
|
||||
{
|
||||
private int total = 0;
|
||||
|
||||
private ChainingURSRowHandler()
|
||||
private ChainingURSResultHandler()
|
||||
{
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> result = (Map<String, Object>)valueObject;
|
||||
Map<String, Object> result = (Map<String, Object>)context.getResultObject();
|
||||
|
||||
String label = (String)result.get("label");
|
||||
String zoneId = (String)result.get("zoneId");
|
||||
|
@@ -27,10 +27,10 @@ import org.alfresco.repo.domain.patch.PatchDAO;
|
||||
import org.alfresco.service.cmr.attributes.AttributeService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
/**
|
||||
* Migrate Property-Backed Bean attributes (from 'alf_*attribute*' to 'alf_prop_*')
|
||||
*
|
||||
@@ -63,7 +63,7 @@ public class MigrateAttrPropBackedBeanPatch extends AbstractPatch
|
||||
{
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
PBBRowHandler handler = new PBBRowHandler();
|
||||
PBBesultHandler handler = new PBBesultHandler();
|
||||
patchDAO.migrateOldAttrPropertyBackedBeans(handler);
|
||||
handler.setComponent(handler.currentComponentName, handler.attributeMap); // set last component attribute (if any)
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MigrateAttrPropBackedBeanPatch extends AbstractPatch
|
||||
return msg;
|
||||
}
|
||||
|
||||
private class PBBRowHandler implements RowHandler
|
||||
private class PBBesultHandler implements ResultHandler
|
||||
{
|
||||
private int total = 0;
|
||||
private int totalProps = 0;
|
||||
@@ -86,13 +86,13 @@ public class MigrateAttrPropBackedBeanPatch extends AbstractPatch
|
||||
private Map<String, String> attributeMap = new HashMap<String, String>(10);
|
||||
private String currentComponentName = "";
|
||||
|
||||
private PBBRowHandler()
|
||||
private PBBesultHandler()
|
||||
{
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> result = (Map<String, Object>)valueObject;
|
||||
Map<String, Object> result = (Map<String, Object>)context.getResultObject();
|
||||
|
||||
String componentName = (String)result.get("componentName");
|
||||
String propName = (String)result.get("propName");
|
||||
|
@@ -28,10 +28,10 @@ import org.alfresco.repo.tenant.MultiTAdminServiceImpl;
|
||||
import org.alfresco.service.cmr.attributes.AttributeService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
/**
|
||||
* Migrate Tenant attributes (from 'alf_*attribute*' to 'alf_prop_*')
|
||||
*
|
||||
@@ -62,7 +62,7 @@ public class MigrateAttrTenantsPatch extends AbstractPatch
|
||||
{
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
TenantRowHandler handler = new TenantRowHandler();
|
||||
TenantResultHandler handler = new TenantResultHandler();
|
||||
patchDAO.migrateOldAttrTenants(handler);
|
||||
|
||||
if (handler.total > 0)
|
||||
@@ -79,17 +79,17 @@ public class MigrateAttrTenantsPatch extends AbstractPatch
|
||||
/**
|
||||
* Row handler for migrating tenants
|
||||
*/
|
||||
private class TenantRowHandler implements RowHandler
|
||||
private class TenantResultHandler implements ResultHandler
|
||||
{
|
||||
private int total = 0;
|
||||
|
||||
private TenantRowHandler()
|
||||
private TenantResultHandler()
|
||||
{
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> result = (Map<String, Object>)valueObject;
|
||||
Map<String, Object> result = (Map<String, Object>)context.getResultObject();
|
||||
|
||||
String tenantDomain = (String)result.get("tenantDomain");
|
||||
Boolean isEnabled = (Boolean)result.get("isEnabled");
|
||||
|
@@ -21,10 +21,17 @@ package org.alfresco.repo.domain.activities.ibatis;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.alfresco.repo.domain.activities.ActivitiesDAO;
|
||||
import org.mybatis.spring.support.SqlSessionDaoSupport;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
public class ActivitiesSqlSessionDaoSupport extends SqlSessionDaoSupport implements ActivitiesDAO
|
||||
public class ActivitiesDAOImpl implements ActivitiesDAO
|
||||
{
|
||||
protected SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
public void startTransaction() throws SQLException
|
||||
{
|
||||
// NOOP
|
@@ -29,18 +29,18 @@ import org.alfresco.repo.domain.activities.ActivityFeedEntity;
|
||||
import org.alfresco.repo.domain.activities.ActivityFeedQueryEntity;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implements ActivityFeedDAO
|
||||
public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFeedDAO
|
||||
{
|
||||
public long insertFeedEntry(ActivityFeedEntity activityFeed) throws SQLException
|
||||
{
|
||||
getSqlSession().insert("alfresco.activities.insert.insert_activity_feed", activityFeed);
|
||||
template.insert("alfresco.activities.insert.insert_activity_feed", activityFeed);
|
||||
Long id = activityFeed.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
public int deleteFeedEntries(Date keepDate) throws SQLException
|
||||
{
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feed_entries_older_than_date", keepDate);
|
||||
return template.delete("alfresco.activities.delete_activity_feed_entries_older_than_date", keepDate);
|
||||
}
|
||||
|
||||
public int deleteSiteFeedEntries(String siteId) throws SQLException
|
||||
@@ -48,7 +48,7 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
ActivityFeedEntity params = new ActivityFeedEntity();
|
||||
params.setSiteNetwork(siteId);
|
||||
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feed_for_site_entries", params);
|
||||
return template.delete("alfresco.activities.delete_activity_feed_for_site_entries", params);
|
||||
}
|
||||
|
||||
public int deleteSiteFeedEntries(String siteId, String format, Date keepDate) throws SQLException
|
||||
@@ -58,7 +58,7 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
params.setActivitySummaryFormat(format);
|
||||
params.setPostDate(keepDate);
|
||||
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feed_for_site_entries_older_than_date", params);
|
||||
return template.delete("alfresco.activities.delete_activity_feed_for_site_entries_older_than_date", params);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
params.setActivitySummaryFormat(format);
|
||||
params.setPostDate(keepDate);
|
||||
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feed_for_feeduser_entries_older_than_date", params);
|
||||
return template.delete("alfresco.activities.delete_activity_feed_for_feeduser_entries_older_than_date", params);
|
||||
}
|
||||
|
||||
public int deleteUserFeedEntries(String feedUserId) throws SQLException
|
||||
@@ -77,13 +77,13 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
ActivityFeedEntity params = new ActivityFeedEntity();
|
||||
params.setFeedUserId(feedUserId);
|
||||
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feed_for_feeduser_entries", params);
|
||||
return template.delete("alfresco.activities.delete_activity_feed_for_feeduser_entries", params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ActivityFeedEntity> selectFeedsToClean(int maxFeedSize) throws SQLException
|
||||
{
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_greater_than_max", maxFeedSize);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_greater_than_max", maxFeedSize);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -114,17 +114,17 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
if ((!excludeThisUser) && (!excludeOtherUsers))
|
||||
{
|
||||
// no excludes => everyone => where feed user is me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser_and_site", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser_and_site", params, rowBounds);
|
||||
}
|
||||
else if ((excludeThisUser) && (!excludeOtherUsers))
|
||||
{
|
||||
// exclude feed user => others => where feed user is me and post user is not me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser_others_and_site", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser_others_and_site", params, rowBounds);
|
||||
}
|
||||
else if ((excludeOtherUsers) && (!excludeThisUser))
|
||||
{
|
||||
// exclude others => me => where feed user is me and post user is me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser_me_and_site", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser_me_and_site", params, rowBounds);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -139,17 +139,17 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
if (!excludeThisUser && !excludeOtherUsers)
|
||||
{
|
||||
// no excludes => everyone => where feed user is me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser", params, rowBounds);
|
||||
}
|
||||
else if (excludeThisUser)
|
||||
{
|
||||
// exclude feed user => others => where feed user is me and post user is not me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser_others", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser_others", params, rowBounds);
|
||||
}
|
||||
else if (excludeOtherUsers)
|
||||
{
|
||||
// exclude others => me => where feed user is me and post user is me
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_feeduser_me", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_feeduser_me", params, rowBounds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,6 @@ public class ActivityFeedDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
RowBounds rowBounds = new RowBounds(RowBounds.NO_ROW_OFFSET, rowLimit);
|
||||
|
||||
// for given site
|
||||
return (List<ActivityFeedEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feed_for_site", params, rowBounds);
|
||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_feed_for_site", params, rowBounds);
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
import org.alfresco.repo.domain.activities.ActivityPostDAO;
|
||||
import org.alfresco.repo.domain.activities.ActivityPostEntity;
|
||||
|
||||
public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implements ActivityPostDAO
|
||||
public class ActivityPostDAOImpl extends ActivitiesDAOImpl implements ActivityPostDAO
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ActivityPostEntity> selectPosts(ActivityPostEntity activityPost) throws SQLException
|
||||
@@ -36,11 +36,11 @@ public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
(activityPost.getMaxId() != -1) &&
|
||||
(activityPost.getStatus() != null))
|
||||
{
|
||||
return (List<ActivityPostEntity>)getSqlSession().selectList("alfresco.activities.select_activity_posts", activityPost);
|
||||
return (List<ActivityPostEntity>)template.selectList("alfresco.activities.select_activity_posts", activityPost);
|
||||
}
|
||||
else if (activityPost.getStatus() != null)
|
||||
{
|
||||
return (List<ActivityPostEntity>)getSqlSession().selectList("alfresco.activities.select_activity_posts_by_status_only", activityPost);
|
||||
return (List<ActivityPostEntity>)template.selectList("alfresco.activities.select_activity_posts_by_status_only", activityPost);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -50,17 +50,17 @@ public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
|
||||
public Long getMaxActivitySeq() throws SQLException
|
||||
{
|
||||
return (Long)getSqlSession().selectOne("alfresco.activities.select_activity_post_max_seq");
|
||||
return (Long)template.selectOne("alfresco.activities.select_activity_post_max_seq");
|
||||
}
|
||||
|
||||
public Long getMinActivitySeq() throws SQLException
|
||||
{
|
||||
return (Long)getSqlSession().selectOne("alfresco.activities.select_activity_post_min_seq");
|
||||
return (Long)template.selectOne("alfresco.activities.select_activity_post_min_seq");
|
||||
}
|
||||
|
||||
public Integer getMaxNodeHash() throws SQLException
|
||||
{
|
||||
return (Integer)getSqlSession().selectOne("alfresco.activities.select_activity_post_max_jobtasknode");
|
||||
return (Integer)template.selectOne("alfresco.activities.select_activity_post_max_jobtasknode");
|
||||
}
|
||||
|
||||
public int updatePost(long id, String siteNetwork, String activityData, ActivityPostEntity.STATUS status) throws SQLException
|
||||
@@ -72,7 +72,7 @@ public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
post.setStatus(status.toString());
|
||||
post.setLastModified(new Date());
|
||||
|
||||
return getSqlSession().update("alfresco.activities.update_activity_post_data", post);
|
||||
return template.update("alfresco.activities.update_activity_post_data", post);
|
||||
}
|
||||
|
||||
public int updatePostStatus(long id, ActivityPostEntity.STATUS status) throws SQLException
|
||||
@@ -82,7 +82,7 @@ public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
post.setStatus(status.toString());
|
||||
post.setLastModified(new Date());
|
||||
|
||||
return getSqlSession().update("alfresco.activities.update_activity_post_status", post);
|
||||
return template.update("alfresco.activities.update_activity_post_status", post);
|
||||
}
|
||||
|
||||
public int deletePosts(Date keepDate, ActivityPostEntity.STATUS status) throws SQLException
|
||||
@@ -91,12 +91,12 @@ public class ActivityPostDAOImpl extends ActivitiesSqlSessionDaoSupport implemen
|
||||
params.setPostDate(keepDate);
|
||||
params.setStatus(status.toString());
|
||||
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_posts_older_than_date", params);
|
||||
return template.delete("alfresco.activities.delete_activity_posts_older_than_date", params);
|
||||
}
|
||||
|
||||
public long insertPost(ActivityPostEntity activityPost) throws SQLException
|
||||
{
|
||||
getSqlSession().insert("alfresco.activities.insert.insert_activity_post", activityPost);
|
||||
template.insert("alfresco.activities.insert.insert_activity_post", activityPost);
|
||||
Long id = activityPost.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
@@ -24,18 +24,18 @@ import java.util.List;
|
||||
import org.alfresco.repo.domain.activities.FeedControlDAO;
|
||||
import org.alfresco.repo.domain.activities.FeedControlEntity;
|
||||
|
||||
public class FeedControlDAOImpl extends ActivitiesSqlSessionDaoSupport implements FeedControlDAO
|
||||
public class FeedControlDAOImpl extends ActivitiesDAOImpl implements FeedControlDAO
|
||||
{
|
||||
public long insertFeedControl(FeedControlEntity activityFeedControl) throws SQLException
|
||||
{
|
||||
getSqlSession().insert("alfresco.activities.insert.insert_activity_feedcontrol", activityFeedControl);
|
||||
template.insert("alfresco.activities.insert.insert_activity_feedcontrol", activityFeedControl);
|
||||
Long id = activityFeedControl.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
public int deleteFeedControl(FeedControlEntity activityFeedControl) throws SQLException
|
||||
{
|
||||
return getSqlSession().delete("alfresco.activities.delete_activity_feedcontrol", activityFeedControl);
|
||||
return template.delete("alfresco.activities.delete_activity_feedcontrol", activityFeedControl);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -43,12 +43,12 @@ public class FeedControlDAOImpl extends ActivitiesSqlSessionDaoSupport implement
|
||||
{
|
||||
FeedControlEntity params = new FeedControlEntity(feedUserId);
|
||||
|
||||
return (List<FeedControlEntity>)getSqlSession().selectList("alfresco.activities.select_activity_feedcontrols_for_user", params);
|
||||
return (List<FeedControlEntity>)template.selectList("alfresco.activities.select_activity_feedcontrols_for_user", params);
|
||||
}
|
||||
|
||||
public long selectFeedControl(FeedControlEntity activityFeedControl) throws SQLException
|
||||
{
|
||||
Long id = (Long)getSqlSession().selectOne("alfresco.activities.select_activity_feedcontrol", activityFeedControl);
|
||||
Long id = (Long)template.selectOne("alfresco.activities.select_activity_feedcontrol", activityFeedControl);
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.ibatis.RollupRowHandler;
|
||||
import org.alfresco.ibatis.RollupResultHandler;
|
||||
import org.alfresco.repo.domain.audit.AbstractAuditDAOImpl;
|
||||
import org.alfresco.repo.domain.audit.AuditApplicationEntity;
|
||||
import org.alfresco.repo.domain.audit.AuditDeleteParameters;
|
||||
@@ -34,9 +34,11 @@ import org.alfresco.repo.domain.audit.AuditQueryParameters;
|
||||
import org.alfresco.repo.domain.audit.AuditQueryResult;
|
||||
import org.alfresco.repo.domain.propval.PropertyValueDAO.PropertyFinderCallback;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the DAO for <b>alf_audit_XXX</b> tables.
|
||||
@@ -47,26 +49,26 @@ import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
{
|
||||
private static final String SELECT_MODEL_BY_CRC = "alfresco.audit.select_AuditModelByCrc";
|
||||
private static final String INSERT_MODEL = "alfresco.audit.insert_AuditModel";
|
||||
private static final String INSERT_MODEL = "alfresco.audit.insert.insert_AuditModel";
|
||||
|
||||
private static final String SELECT_APPLICATION_BY_ID = "alfresco.audit.select_AuditApplicationById";
|
||||
private static final String SELECT_APPLICATION_BY_NAME_ID = "alfresco.audit.select_AuditApplicationByNameId";
|
||||
private static final String INSERT_APPLICATION = "alfresco.audit.insert_AuditApplication";
|
||||
private static final String INSERT_APPLICATION = "alfresco.audit.insert.insert_AuditApplication";
|
||||
private static final String UPDATE_APPLICATION = "alfresco.audit.update_AuditApplication";
|
||||
|
||||
private static final String DELETE_ENTRIES = "alfresco.audit.delete_AuditEntries";
|
||||
private static final String INSERT_ENTRY = "alfresco.audit.insert_AuditEntry";
|
||||
private static final String INSERT_ENTRY = "alfresco.audit.insert.insert_AuditEntry";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String SELECT_ENTRIES_SIMPLE = "alfresco.audit.select_AuditEntriesSimple";
|
||||
private static final String SELECT_ENTRIES_WITH_VALUES = "alfresco.audit.select_AuditEntriesWithValues";
|
||||
private static final String SELECT_ENTRIES_WITHOUT_VALUES = "alfresco.audit.select_AuditEntriesWithoutValues";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,7 +76,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
{
|
||||
AuditModelEntity entity = new AuditModelEntity();
|
||||
entity.setContentCrc(crc);
|
||||
entity = (AuditModelEntity) template.queryForObject(
|
||||
entity = (AuditModelEntity) template.selectOne(
|
||||
SELECT_MODEL_BY_CRC,
|
||||
entity);
|
||||
// Done
|
||||
@@ -87,8 +89,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
AuditModelEntity entity = new AuditModelEntity();
|
||||
entity.setContentDataId(contentDataId);
|
||||
entity.setContentCrc(crc);
|
||||
Long id = (Long) template.insert(INSERT_MODEL, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_MODEL, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||
params.put("id", id);
|
||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.queryForObject(
|
||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.selectOne(
|
||||
SELECT_APPLICATION_BY_ID,
|
||||
params);
|
||||
// Done
|
||||
@@ -121,7 +122,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
|
||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||
params.put("id", appNamePair.getFirst());
|
||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.queryForObject(
|
||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.selectOne(
|
||||
SELECT_APPLICATION_BY_NAME_ID,
|
||||
params);
|
||||
// Done
|
||||
@@ -140,8 +141,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
entity.setApplicationNameId(appNameId);
|
||||
entity.setAuditModelId(modelId);
|
||||
entity.setDisabledPathsId(disabledPathsId);
|
||||
Long id = (Long) template.insert(INSERT_APPLICATION, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_APPLICATION, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,13 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
updateEntity.setAuditModelId(entity.getAuditModelId());
|
||||
updateEntity.setDisabledPathsId(entity.getDisabledPathsId());
|
||||
|
||||
template.update(UPDATE_APPLICATION, updateEntity, 1);
|
||||
int updated = template.update(UPDATE_APPLICATION, updateEntity);
|
||||
if (updated != 1)
|
||||
{
|
||||
// unexpected number of rows affected
|
||||
throw new ConcurrencyFailureException("Incorrect number of rows affected for updateAuditApplication: " + updateEntity + ": expected 1, actual " + updated);
|
||||
}
|
||||
|
||||
// Done
|
||||
return updateEntity;
|
||||
}
|
||||
@@ -186,8 +192,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
entity.setAuditTime(time);
|
||||
entity.setAuditUserId(usernameId);
|
||||
entity.setAuditValuesId(valuesId);
|
||||
Long id = (Long) template.insert(INSERT_ENTRY, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_ENTRY, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -275,7 +280,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
}
|
||||
};
|
||||
|
||||
List<AuditQueryResult> rows = template.queryForList(SELECT_ENTRIES_WITHOUT_VALUES, params, 0, maxResults);
|
||||
List<AuditQueryResult> rows = (List<AuditQueryResult>) template.selectList(SELECT_ENTRIES_WITHOUT_VALUES, params, new RowBounds(0, maxResults));
|
||||
for (AuditQueryResult row : rows)
|
||||
{
|
||||
resultsByValueId.put(row.getAuditValuesId(), row);
|
||||
@@ -303,23 +308,24 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
}
|
||||
else
|
||||
{
|
||||
// RowHandlers in RowHandlers: See 'groupBy' issue https://issues.apache.org/jira/browse/IBATIS-503
|
||||
RowHandler queryRowHandler = new RowHandler()
|
||||
// RowHandlers in RowHandlers: See 'groupBy' issue for iBatis 2.x https://issues.apache.org/jira/browse/IBATIS-503
|
||||
ResultHandler queryResultHandler = new ResultHandler()
|
||||
{
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
rowHandler.processResult((AuditQueryResult)valueObject);
|
||||
rowHandler.processResult((AuditQueryResult)context.getResultObject());
|
||||
}
|
||||
};
|
||||
RollupRowHandler rollupRowHandler = new RollupRowHandler(
|
||||
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
||||
new String[] {"auditEntryId"},
|
||||
"auditValueRows",
|
||||
queryRowHandler,
|
||||
queryResultHandler,
|
||||
maxResults);
|
||||
|
||||
template.queryWithRowHandler(rowHandler.valuesRequired() ? SELECT_ENTRIES_WITH_VALUES
|
||||
: SELECT_ENTRIES_WITHOUT_VALUES, params, rollupRowHandler);
|
||||
rollupRowHandler.processLastResults();
|
||||
template.select(rowHandler.valuesRequired() ? SELECT_ENTRIES_WITH_VALUES
|
||||
: SELECT_ENTRIES_WITHOUT_VALUES, params, rollupResultHandler);
|
||||
rollupResultHandler.processLastResults();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,12 @@ public abstract class AbstractAVMVersionRootDAOImpl implements AVMVersionRootDAO
|
||||
ParameterCheck.mandatory("vrEntity.id", vrEntity.getId());
|
||||
ParameterCheck.mandatory("vrEntity.version", vrEntity.getVersion());
|
||||
|
||||
updateVersionRootEntity(vrEntity);
|
||||
int updated = updateVersionRootEntity(vrEntity);
|
||||
if (updated != 1)
|
||||
{
|
||||
// unexpected number of rows affected
|
||||
throw new ConcurrencyFailureException("Incorrect number of rows affected for updateVersionRoot: " + vrEntity + ": expected 1, actual " + updated);
|
||||
}
|
||||
|
||||
// Cache it
|
||||
vrEntityCache.put(new Pair<Long, Integer>(vrEntity.getStoreId(), vrEntity.getVersion()), vrEntity.getId());
|
||||
@@ -231,7 +236,7 @@ public abstract class AbstractAVMVersionRootDAOImpl implements AVMVersionRootDAO
|
||||
}
|
||||
|
||||
protected abstract AVMVersionRootEntity createVersionRootEntity(AVMVersionRootEntity vrEntity);
|
||||
protected abstract void updateVersionRootEntity(AVMVersionRootEntity updateVersionRootEntity);
|
||||
protected abstract int updateVersionRootEntity(AVMVersionRootEntity updateVersionRootEntity);
|
||||
protected abstract int deleteVersionRootEntity(long vrEntityId);
|
||||
protected abstract AVMVersionRootEntity getVersionRootEntityMaxVersion(long storeId);
|
||||
protected abstract Long getVersionRootEntityMaxVersionId(long storeId);
|
||||
|
@@ -22,7 +22,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.domain.avm.AbstractAVMLockDAOImpl;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMLock DAO.
|
||||
@@ -35,11 +35,12 @@ public class AVMLockDAOImpl extends AbstractAVMLockDAOImpl
|
||||
private static final String DELETE_MATCHING_AVM_LOCKS_1_KV ="alfresco.avm.delete_PropertyUniqueContextByValuesWithOneKV";
|
||||
private static final String DELETE_MATCHING_AVM_LOCKS_0_KV ="alfresco.avm.delete_PropertyUniqueContextByValuesWithNoKV";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -28,9 +28,10 @@ import org.alfresco.repo.domain.avm.AVMNodePropertyEntity;
|
||||
import org.alfresco.repo.domain.avm.AbstractAVMNodeDAOImpl;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMNode DAO.
|
||||
@@ -42,7 +43,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(AVMNodeDAOImpl.class);
|
||||
|
||||
private static final String INSERT_AVM_NODE = "alfresco.avm.insert_AVMNode";
|
||||
private static final String INSERT_AVM_NODE = "alfresco.avm.insert.insert_AVMNode";
|
||||
private static final String SELECT_AVM_NODE_BY_ID = "alfresco.avm.select_AVMNodeById";
|
||||
private static final String UPDATE_AVM_NODE = "alfresco.avm.update_AVMNode";
|
||||
private static final String UPDATE_AVM_NODE_MODTIME_AND_GUID = "alfresco.avm.update_AVMNode_modTimeAndGuid";
|
||||
@@ -60,29 +61,29 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
private static final String SELECT_AVM_CONTENT_URLS_FOR_PLAIN_FILES = "alfresco.avm.select_ContentUrlsForPlainFiles";
|
||||
|
||||
private static final String SELECT_AVM_NODE_ASPECTS = "alfresco.avm.select_AVMNodeAspects";
|
||||
private static final String INSERT_AVM_NODE_ASPECT = "alfresco.avm.insert_AVMNodeAspect";
|
||||
private static final String INSERT_AVM_NODE_ASPECT = "alfresco.avm.insert.insert_AVMNodeAspect";
|
||||
private static final String DELETE_AVM_NODE_ASPECT = "alfresco.avm.delete_AVMNodeAspect";
|
||||
private static final String DELETE_AVM_NODE_ASPECTS = "alfresco.avm.delete_AVMNodeAspects";
|
||||
|
||||
private static final String INSERT_AVM_NODE_PROP = "alfresco.avm.insert_AVMNodeProperty";
|
||||
private static final String INSERT_AVM_NODE_PROP = "alfresco.avm.insert.insert_AVMNodeProperty";
|
||||
private static final String UPDATE_AVM_NODE_PROP = "alfresco.avm.update_AVMNodeProperty";
|
||||
private static final String SELECT_AVM_NODE_PROP = "alfresco.avm.select_AVMNodeProperty";
|
||||
private static final String SELECT_AVM_NODE_PROPS = "alfresco.avm.select_AVMNodeProperties";
|
||||
private static final String DELETE_AVM_NODE_PROP = "alfresco.avm.delete_AVMNodeProperty";
|
||||
private static final String DELETE_AVM_NODE_PROPS = "alfresco.avm.delete_AVMNodeProperties";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AVMNodeEntity createNodeEntity(AVMNodeEntity nodeEntity)
|
||||
{
|
||||
Long id = (Long) template.insert(INSERT_AVM_NODE, nodeEntity);
|
||||
nodeEntity.setId(id);
|
||||
template.insert(INSERT_AVM_NODE, nodeEntity);
|
||||
return nodeEntity;
|
||||
}
|
||||
|
||||
@@ -91,7 +92,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", id);
|
||||
return (AVMNodeEntity) template.queryForObject(SELECT_AVM_NODE_BY_ID, params);
|
||||
return (AVMNodeEntity) template.selectOne(SELECT_AVM_NODE_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,7 +143,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", storeId);
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_NEW_IN_STORE, params);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODES_NEW_IN_STORE, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -151,7 +152,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", storeId);
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_NEW_LAYERED_IN_STORE, params);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODES_NEW_LAYERED_IN_STORE, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -160,7 +161,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", storeId);
|
||||
return (List<Long>) template.queryForList(SELECT_AVM_NODE_IDS_NEW_LAYERED_IN_STORE, params);
|
||||
return (List<Long>) template.selectList(SELECT_AVM_NODE_IDS_NEW_LAYERED_IN_STORE, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -171,7 +172,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
params.put("bool", false);
|
||||
|
||||
// all nodes with null parent and not a root
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_NULL_PARENT_AND_ISROOT_TF, params, 0, maxSize);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODES_NULL_PARENT_AND_ISROOT_TF, params, new RowBounds(0, maxSize));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -182,45 +183,45 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
params.put("bool", true);
|
||||
|
||||
// all primary layered directories
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_LAYERED_DIRECTORIES_AND_PRIMARY_TF, params);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODES_LAYERED_DIRECTORIES_AND_PRIMARY_TF, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<AVMNodeEntity> getAllLayeredFileNodeEntities()
|
||||
{
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_LAYERED_FILES);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODES_LAYERED_FILES);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getPlainFileContentUrls(ContentUrlHandler handler)
|
||||
{
|
||||
CleanRowHandler rowHandler = new CleanRowHandler(handler);
|
||||
CleanResultHandler resultHandler = new CleanResultHandler(handler);
|
||||
|
||||
template.queryWithRowHandler(SELECT_AVM_CONTENT_URLS_FOR_PLAIN_FILES, rowHandler);
|
||||
template.selectList(SELECT_AVM_CONTENT_URLS_FOR_PLAIN_FILES, resultHandler);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" Listed " + rowHandler.total + " content URLs");
|
||||
logger.debug(" Listed " + resultHandler.total + " content URLs");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Row handler for cleaning content URLs
|
||||
*/
|
||||
private static class CleanRowHandler implements RowHandler
|
||||
private static class CleanResultHandler implements ResultHandler
|
||||
{
|
||||
private final ContentUrlHandler handler;
|
||||
|
||||
private int total = 0;
|
||||
|
||||
private CleanRowHandler(ContentUrlHandler handler)
|
||||
private CleanResultHandler(ContentUrlHandler handler)
|
||||
{
|
||||
this.handler = handler;
|
||||
}
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
handler.handle((String)valueObject);
|
||||
handler.handle((String)context.getResultObject());
|
||||
total++;
|
||||
if (logger.isDebugEnabled() && (total == 0 || (total % 1000 == 0) ))
|
||||
{
|
||||
@@ -235,7 +236,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", nodeId);
|
||||
return (List<Long>) template.queryForList(SELECT_AVM_NODE_ASPECTS, params);
|
||||
return (List<Long>) template.selectList(SELECT_AVM_NODE_ASPECTS, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,7 +280,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
propEntity.setNodeId(nodeId);
|
||||
propEntity.setQnameId(qnameId);
|
||||
|
||||
return (AVMNodePropertyEntity) template.queryForObject(SELECT_AVM_NODE_PROP, propEntity);
|
||||
return (AVMNodePropertyEntity) template.selectOne(SELECT_AVM_NODE_PROP, propEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,7 +290,7 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", nodeId);
|
||||
|
||||
return (List<AVMNodePropertyEntity>) template.queryForList(SELECT_AVM_NODE_PROPS, params);
|
||||
return (List<AVMNodePropertyEntity>) template.selectList(SELECT_AVM_NODE_PROPS, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -26,7 +26,7 @@ import org.alfresco.repo.domain.avm.AVMChildEntryEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMHistoryLinkEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMMergeLinkEntity;
|
||||
import org.alfresco.repo.domain.avm.AbstractAVMNodeLinksDAOImpl;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMNodeLinks DAO.
|
||||
@@ -50,7 +50,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
|
||||
private static final String SELECT_AVM_NODE_CHILD_ENTRIES_BY_CHILD ="alfresco.avm.select_AVMNodeChildEntriesByChild"; // child
|
||||
|
||||
private static final String INSERT_AVM_NODE_CHILD_ENTRY ="alfresco.avm.insert_AVMChildEntry"; // parent + name + child
|
||||
private static final String INSERT_AVM_NODE_CHILD_ENTRY ="alfresco.avm.insert.insert_AVMChildEntry"; // parent + name + child
|
||||
|
||||
private static final String UPDATE_AVM_NODE_CHILD_ENTRY ="alfresco.avm.update_AVMChildEntry"; // parent + child (update name)
|
||||
|
||||
@@ -60,30 +60,32 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
private static final String DELETE_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_CHILD ="alfresco.avm.delete_AVMChildEntryByParentAndChild"; // parent + child
|
||||
private static final String DELETE_AVM_NODE_CHILD_ENTRIES_BY_PARENT ="alfresco.avm.delete_AVMNodeChildEntriesByParent"; // parent
|
||||
|
||||
private static final String INSERT_AVM_MERGE_LINK ="alfresco.avm.insert_AVMMergeLink";
|
||||
private static final String INSERT_AVM_MERGE_LINK ="alfresco.avm.insert.insert_AVMMergeLink";
|
||||
private static final String DELETE_AVM_MERGE_LINK ="alfresco.avm.delete_AVMMergeLink";
|
||||
|
||||
private static final String SELECT_AVM_MERGE_LINKS_BY_FROM ="alfresco.avm.select_AVMMergeLinksByFrom";
|
||||
private static final String SELECT_AVM_MERGE_LINK_BY_TO ="alfresco.avm.select_AVMMergeLinkByTo";
|
||||
|
||||
private static final String INSERT_AVM_HISTORY_LINK ="alfresco.avm.insert_AVMHistoryLink";
|
||||
private static final String INSERT_AVM_HISTORY_LINK ="alfresco.avm.insert.insert_AVMHistoryLink";
|
||||
private static final String DELETE_AVM_HISTORY_LINK ="alfresco.avm.delete_AVMHistoryLink";
|
||||
|
||||
private static final String SELECT_AVM_HISTORY_LINKS_BY_ANCESTOR ="alfresco.avm.select_AVMHistoryLinksByAncestor";
|
||||
private static final String SELECT_AVM_HISTORY_LINK_BY_DESCENDENT ="alfresco.avm.select_AVMHistoryLinkByDescendent";
|
||||
private static final String SELECT_AVM_HISTORY_LINK ="alfresco.avm.select_AVMHistoryLink";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
// Initial generic fix for ALF-1940 (pending SAIL-349)
|
||||
// Note: in order to override to false DB must be setup to be case-insensitive (at least on column avm_child_entries.name)
|
||||
private boolean toLower = true;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
}
|
||||
|
||||
public void setToLower(boolean toLower)
|
||||
{
|
||||
this.toLower = toLower;
|
||||
@@ -94,9 +96,9 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
if (toLower)
|
||||
{
|
||||
return (AVMChildEntryEntity) template.queryForObject(SELECT_AVM_NODE_CHILD_ENTRY_L, childEntryEntity);
|
||||
return (AVMChildEntryEntity) template.selectOne(SELECT_AVM_NODE_CHILD_ENTRY_L, childEntryEntity);
|
||||
}
|
||||
return (AVMChildEntryEntity) template.queryForObject(SELECT_AVM_NODE_CHILD_ENTRY, childEntryEntity);
|
||||
return (AVMChildEntryEntity) template.selectOne(SELECT_AVM_NODE_CHILD_ENTRY, childEntryEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,16 +108,16 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
|
||||
if (toLower)
|
||||
{
|
||||
return (AVMChildEntryEntity) template.queryForObject(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_NAME_L, childEntryEntity);
|
||||
return (AVMChildEntryEntity) template.selectOne(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_NAME_L, childEntryEntity);
|
||||
}
|
||||
return (AVMChildEntryEntity) template.queryForObject(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_NAME, childEntryEntity);
|
||||
return (AVMChildEntryEntity) template.selectOne(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_NAME, childEntryEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AVMChildEntryEntity getChildEntryEntity(long parentNodeId, long childNodeId)
|
||||
{
|
||||
AVMChildEntryEntity childEntryEntity = new AVMChildEntryEntity(parentNodeId, childNodeId);
|
||||
return (AVMChildEntryEntity) template.queryForObject(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_CHILD, childEntryEntity);
|
||||
return (AVMChildEntryEntity) template.selectOne(SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_CHILD, childEntryEntity);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -124,7 +126,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", parentNodeId);
|
||||
return (List<AVMChildEntryEntity>) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT, params);
|
||||
return (List<AVMChildEntryEntity>) template.selectList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -137,9 +139,9 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
|
||||
if (toLower)
|
||||
{
|
||||
return (List<AVMChildEntryEntity>) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN_L, params);
|
||||
return (List<AVMChildEntryEntity>) template.selectList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN_L, params);
|
||||
}
|
||||
return (List<AVMChildEntryEntity>) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN, params);
|
||||
return (List<AVMChildEntryEntity>) template.selectList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -148,7 +150,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", childNodeId);
|
||||
return (List<AVMChildEntryEntity>) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_CHILD, params);
|
||||
return (List<AVMChildEntryEntity>) template.selectList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_CHILD, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,7 +215,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", mergeToNodeId);
|
||||
return (AVMMergeLinkEntity) template.queryForObject(SELECT_AVM_MERGE_LINK_BY_TO, params);
|
||||
return (AVMMergeLinkEntity) template.selectOne(SELECT_AVM_MERGE_LINK_BY_TO, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -222,7 +224,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", mergeFromNodeId);
|
||||
return (List<AVMMergeLinkEntity>) template.queryForList(SELECT_AVM_MERGE_LINKS_BY_FROM, params);
|
||||
return (List<AVMMergeLinkEntity>) template.selectList(SELECT_AVM_MERGE_LINKS_BY_FROM, params);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,14 +247,14 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", descendentNodeId);
|
||||
return (AVMHistoryLinkEntity) template.queryForObject(SELECT_AVM_HISTORY_LINK_BY_DESCENDENT, params);
|
||||
return (AVMHistoryLinkEntity) template.selectOne(SELECT_AVM_HISTORY_LINK_BY_DESCENDENT, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AVMHistoryLinkEntity getHistoryLinkEntity(long ancestorNodeId, long descendentNodeId)
|
||||
{
|
||||
AVMHistoryLinkEntity hLinkEntity = new AVMHistoryLinkEntity(ancestorNodeId, descendentNodeId);
|
||||
return (AVMHistoryLinkEntity) template.queryForObject(SELECT_AVM_HISTORY_LINK, hLinkEntity);
|
||||
return (AVMHistoryLinkEntity) template.selectOne(SELECT_AVM_HISTORY_LINK, hLinkEntity);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -261,6 +263,6 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", ancestorNodeId);
|
||||
return (List<AVMHistoryLinkEntity>) template.queryForList(SELECT_AVM_HISTORY_LINKS_BY_ANCESTOR, params);
|
||||
return (List<AVMHistoryLinkEntity>) template.selectList(SELECT_AVM_HISTORY_LINKS_BY_ANCESTOR, params);
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
import org.alfresco.repo.domain.avm.AVMStoreEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMStorePropertyEntity;
|
||||
import org.alfresco.repo.domain.avm.AbstractAVMStoreDAOImpl;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMStore DAO.
|
||||
@@ -43,11 +43,11 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
private static final String SELECT_AVM_STORE_BY_ROOT_NODE_ID ="alfresco.avm.select_AVMStoreByRootNodeId";
|
||||
private static final String SELECT_AVM_STORE_ALL ="alfresco.avm.select_AVMStoreAll";
|
||||
|
||||
private static final String INSERT_AVM_STORE ="alfresco.avm.insert_AVMStore";
|
||||
private static final String INSERT_AVM_STORE ="alfresco.avm.insert.insert_AVMStore";
|
||||
private static final String DELETE_AVM_STORE ="alfresco.avm.delete_AVMStore";
|
||||
private static final String UPDATE_AVM_STORE ="alfresco.avm.update_AVMStore";
|
||||
|
||||
private static final String INSERT_AVM_STORE_PROP ="alfresco.avm.insert_AVMStoreProperty";
|
||||
private static final String INSERT_AVM_STORE_PROP ="alfresco.avm.insert.insert_AVMStoreProperty";
|
||||
private static final String UPDATE_AVM_STORE_PROP ="alfresco.avm.update_AVMStoreProperty";
|
||||
private static final String SELECT_AVM_STORE_PROP ="alfresco.avm.select_AVMStoreProperty";
|
||||
private static final String SELECT_AVM_STORE_PROPS ="alfresco.avm.select_AVMStoreProperties";
|
||||
@@ -62,17 +62,18 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
private static final String DELETE_AVM_STORE_PROPS ="alfresco.avm.delete_AVMStoreProperties";
|
||||
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
// Initial generic fixes for ALF-2278 (pending SAIL-365) & ALF-498 (pending SAIL-359)
|
||||
// Note: in order to override to false, DB must be setup to be case-insensitive (at least on column avm_stores.name)
|
||||
private boolean toLower = true;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
}
|
||||
|
||||
public void setToLower(boolean toLower)
|
||||
{
|
||||
this.toLower = toLower;
|
||||
@@ -83,7 +84,7 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", id);
|
||||
return (AVMStoreEntity) template.queryForObject(SELECT_AVM_STORE_BY_ID, params);
|
||||
return (AVMStoreEntity) template.selectOne(SELECT_AVM_STORE_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,9 +95,9 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
|
||||
if (toLower)
|
||||
{
|
||||
return (AVMStoreEntity) template.queryForObject(SELECT_AVM_STORE_BY_KEY_L, storeEntity);
|
||||
return (AVMStoreEntity) template.selectOne(SELECT_AVM_STORE_BY_KEY_L, storeEntity);
|
||||
}
|
||||
return (AVMStoreEntity) template.queryForObject(SELECT_AVM_STORE_BY_KEY, storeEntity);
|
||||
return (AVMStoreEntity) template.selectOne(SELECT_AVM_STORE_BY_KEY, storeEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,21 +105,20 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", rootNodeId);
|
||||
return (AVMStoreEntity) template.queryForObject(SELECT_AVM_STORE_BY_ROOT_NODE_ID, params);
|
||||
return (AVMStoreEntity) template.selectOne(SELECT_AVM_STORE_BY_ROOT_NODE_ID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<AVMStoreEntity> getAllStoreEntities()
|
||||
{
|
||||
return (List<AVMStoreEntity>) template.queryForList(SELECT_AVM_STORE_ALL);
|
||||
return (List<AVMStoreEntity>) template.selectList(SELECT_AVM_STORE_ALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AVMStoreEntity createStoreEntity(AVMStoreEntity storeEntity)
|
||||
{
|
||||
Long id = (Long) template.insert(INSERT_AVM_STORE, storeEntity);
|
||||
storeEntity.setId(id);
|
||||
template.insert(INSERT_AVM_STORE, storeEntity);
|
||||
return storeEntity;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
propEntity.setAvmStoreId(storeId);
|
||||
propEntity.setQnameId(qnameId);
|
||||
|
||||
return (AVMStorePropertyEntity) template.queryForObject(SELECT_AVM_STORE_PROP, propEntity);
|
||||
return (AVMStorePropertyEntity) template.selectOne(SELECT_AVM_STORE_PROP, propEntity);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -169,7 +169,7 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
|
||||
try
|
||||
{
|
||||
return (List<AVMStorePropertyEntity>) template.queryForList(SELECT_AVM_STORE_PROPS, params);
|
||||
return (List<AVMStorePropertyEntity>) template.selectList(SELECT_AVM_STORE_PROPS, params);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
@@ -187,9 +187,9 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
|
||||
if (toLower)
|
||||
{
|
||||
return (List<AVMStorePropertyEntity>) template.queryForList(SELECT_AVM_STORE_PROPS_BY_KEY_PATTERN_L, params);
|
||||
return (List<AVMStorePropertyEntity>) template.selectList(SELECT_AVM_STORE_PROPS_BY_KEY_PATTERN_L, params);
|
||||
}
|
||||
return (List<AVMStorePropertyEntity>) template.queryForList(SELECT_AVM_STORE_PROPS_BY_KEY_PATTERN, params);
|
||||
return (List<AVMStorePropertyEntity>) template.selectList(SELECT_AVM_STORE_PROPS_BY_KEY_PATTERN, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -203,9 +203,9 @@ public class AVMStoreDAOImpl extends AbstractAVMStoreDAOImpl
|
||||
|
||||
if (toLower)
|
||||
{
|
||||
return (List<AVMStorePropertyEntity>) template.queryForList(SELECT_AVM_STORE_PROPS_BY_STORE_AND_KEY_PATTERN_L, params);
|
||||
return (List<AVMStorePropertyEntity>) template.selectList(SELECT_AVM_STORE_PROPS_BY_STORE_AND_KEY_PATTERN_L, params);
|
||||
}
|
||||
return (List<AVMStorePropertyEntity>) template.queryForList(SELECT_AVM_STORE_PROPS_BY_STORE_AND_KEY_PATTERN, params);
|
||||
return (List<AVMStorePropertyEntity>) template.selectList(SELECT_AVM_STORE_PROPS_BY_STORE_AND_KEY_PATTERN, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -26,7 +26,7 @@ import org.alfresco.repo.domain.avm.AVMStoreEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMVersionLayeredNodeEntryEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMVersionRootEntity;
|
||||
import org.alfresco.repo.domain.avm.AbstractAVMVersionRootDAOImpl;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMVersionRoot DAO
|
||||
@@ -36,7 +36,7 @@ import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
*/
|
||||
public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
private static final String INSERT_AVM_VERSION_ROOT ="alfresco.avm.insert_AVMVersionRoot";
|
||||
private static final String INSERT_AVM_VERSION_ROOT ="alfresco.avm.insert.insert_AVMVersionRoot";
|
||||
private static final String DELETE_AVM_VERSION_ROOT ="alfresco.avm.delete_AVMVersionRoot";
|
||||
private static final String UPDATE_AVM_VERSION_ROOT ="alfresco.avm.update_AVMVersionRoot";
|
||||
|
||||
@@ -54,30 +54,30 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
private static final String SELECT_AVM_VERSION_ROOTS_BY_VERSION_FROM ="alfresco.avm.select_AVMVersionRootsByVersionFrom";
|
||||
private static final String SELECT_AVM_VERSION_ROOTS_BY_VERSIONS_BETWEEN ="alfresco.avm.select_AVMVersionRootsByVersionsBetween";
|
||||
|
||||
private static final String INSERT_AVM_VERSION_LAYERED_NODE_ENTRY ="alfresco.avm.insert_AVMVersionLayeredNodeEntry";
|
||||
private static final String INSERT_AVM_VERSION_LAYERED_NODE_ENTRY ="alfresco.avm.insert.insert_AVMVersionLayeredNodeEntry";
|
||||
private static final String DELETE_AVM_VERSION_LAYERED_NODE_ENTRIES ="alfresco.avm.delete_AVMVersionLayeredNodeEntries";
|
||||
private static final String SELECT_AVM_VERSION_LAYERED_NODE_ENTRIES ="alfresco.avm.select_AVMVersionLayeredNodeEntries";
|
||||
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected AVMVersionRootEntity createVersionRootEntity(AVMVersionRootEntity newVersionRootEntity)
|
||||
{
|
||||
Long id = (Long) template.insert(INSERT_AVM_VERSION_ROOT, newVersionRootEntity);
|
||||
newVersionRootEntity.setId(id);
|
||||
template.insert(INSERT_AVM_VERSION_ROOT, newVersionRootEntity);
|
||||
return newVersionRootEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateVersionRootEntity(AVMVersionRootEntity updateVersionRootEntity)
|
||||
protected int updateVersionRootEntity(AVMVersionRootEntity updateVersionRootEntity)
|
||||
{
|
||||
template.update(UPDATE_AVM_VERSION_ROOT, updateVersionRootEntity, 1);
|
||||
return template.update(UPDATE_AVM_VERSION_ROOT, updateVersionRootEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,7 +85,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
AVMStoreEntity storeEntity = new AVMStoreEntity();
|
||||
storeEntity.setId(storeId);
|
||||
return (AVMVersionRootEntity) template.queryForObject(SELECT_AVM_VERSION_ROOT_MAX_VERSION, storeEntity);
|
||||
return (AVMVersionRootEntity) template.selectOne(SELECT_AVM_VERSION_ROOT_MAX_VERSION, storeEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", storeId);
|
||||
Integer maxVersionId = (Integer) template.queryForObject(SELECT_AVM_VERSION_ROOT_MAX_VERSION_ID, params);
|
||||
Integer maxVersionId = (Integer) template.selectOne(SELECT_AVM_VERSION_ROOT_MAX_VERSION_ID, params);
|
||||
if (maxVersionId == null)
|
||||
{
|
||||
return null;
|
||||
@@ -106,7 +106,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", vrEntityId);
|
||||
return (AVMVersionRootEntity) template.queryForObject(SELECT_AVM_VERSION_ROOT_BY_ID, params);
|
||||
return (AVMVersionRootEntity) template.selectOne(SELECT_AVM_VERSION_ROOT_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,7 +116,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
vrEntity.setStoreId(storeId);
|
||||
vrEntity.setVersion(version);
|
||||
|
||||
return (AVMVersionRootEntity) template.queryForObject(SELECT_AVM_VERSION_ROOT_BY_STORE_VERSION, vrEntity);
|
||||
return (AVMVersionRootEntity) template.selectOne(SELECT_AVM_VERSION_ROOT_BY_STORE_VERSION, vrEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,7 +124,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", rootNodeId);
|
||||
return (AVMVersionRootEntity) template.queryForObject(SELECT_AVM_VERSION_ROOT_BY_ROOT_NODE_ID, params);
|
||||
return (AVMVersionRootEntity) template.selectOne(SELECT_AVM_VERSION_ROOT_BY_ROOT_NODE_ID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -133,7 +133,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", storeId);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_STORE_ID, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_STORE_ID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -142,7 +142,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(2);
|
||||
params.put("id", storeId);
|
||||
params.put("to", to);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_DATE_TO, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_DATE_TO, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -151,7 +151,7 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(2);
|
||||
params.put("id", storeId);
|
||||
params.put("from", from);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_DATE_FROM, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_DATE_FROM, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -161,9 +161,10 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
params.put("id", storeId);
|
||||
params.put("from", from);
|
||||
params.put("to", to);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_DATES_BETWEEN, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_DATES_BETWEEN, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<AVMVersionRootEntity> getVersionRootEntitiesByVersionsBetween(long storeId, long from, long to)
|
||||
{
|
||||
@@ -171,25 +172,27 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
params.put("id", storeId);
|
||||
params.put("from", from);
|
||||
params.put("to", to);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_VERSIONS_BETWEEN, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_VERSIONS_BETWEEN, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<AVMVersionRootEntity> getVersionRootEntitiesByVersionsFrom(long storeId, long from)
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(2);
|
||||
params.put("id", storeId);
|
||||
params.put("from", from);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_VERSION_FROM, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_VERSION_FROM, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<AVMVersionRootEntity> getVersionRootEntitiesByVersionsTo(long storeId, long to)
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(2);
|
||||
params.put("id", storeId);
|
||||
params.put("to", to);
|
||||
return (List<AVMVersionRootEntity>) template.queryForList(SELECT_AVM_VERSION_ROOTS_BY_VERSION_TO, params);
|
||||
return (List<AVMVersionRootEntity>) template.selectList(SELECT_AVM_VERSION_ROOTS_BY_VERSION_TO, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,6 +228,6 @@ public class AVMVersionRootDAOImpl extends AbstractAVMVersionRootDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", versionRootId);
|
||||
return (List<AVMVersionLayeredNodeEntryEntity>) template.queryForList(SELECT_AVM_VERSION_LAYERED_NODE_ENTRIES, params);
|
||||
return (List<AVMVersionLayeredNodeEntryEntity>) template.selectList(SELECT_AVM_VERSION_LAYERED_NODE_ENTRIES, params);
|
||||
}
|
||||
}
|
||||
|
@@ -35,9 +35,10 @@ import org.alfresco.repo.domain.contentdata.ContentUrlUpdateEntity;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the ContentData DAO.
|
||||
@@ -53,27 +54,30 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
private static final String SELECT_CONTENT_URLS_ORPHANED = "alfresco.content.select_ContentUrlsOrphaned";
|
||||
private static final String SELECT_CONTENT_DATA_BY_ID = "alfresco.content.select_ContentDataById";
|
||||
private static final String SELECT_CONTENT_DATA_BY_NODE_AND_QNAME = "alfresco.content.select_ContentDataByNodeAndQName";
|
||||
private static final String INSERT_CONTENT_URL = "alfresco.content.insert_ContentUrl";
|
||||
private static final String INSERT_CONTENT_DATA = "alfresco.content.insert_ContentData";
|
||||
private static final String INSERT_CONTENT_URL = "alfresco.content.insert.insert_ContentUrl";
|
||||
private static final String INSERT_CONTENT_DATA = "alfresco.content.insert.insert_ContentData";
|
||||
private static final String UPDATE_CONTENT_URL_ORPHAN_TIME = "alfresco.content.update_ContentUrlOrphanTime";
|
||||
private static final String UPDATE_CONTENT_DATA = "alfresco.content.update_ContentData";
|
||||
private static final String DELETE_CONTENT_DATA = "alfresco.content.delete_ContentData";
|
||||
private static final String DELETE_CONTENT_URLS = "alfresco.content.delete_ContentUrls";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
public Pair<Long, String> createContentUrlOrphaned(String contentUrl, Date orphanTime)
|
||||
{
|
||||
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
||||
contentUrlEntity.setContentUrl(contentUrl);
|
||||
contentUrlEntity.setSize(0L);
|
||||
contentUrlEntity.setOrphanTime(orphanTime == null ? System.currentTimeMillis() : orphanTime.getTime());
|
||||
Long id = (Long) template.insert(INSERT_CONTENT_URL, contentUrlEntity);
|
||||
template.insert(INSERT_CONTENT_URL, contentUrlEntity);
|
||||
Long id = contentUrlEntity.getId();
|
||||
// Done
|
||||
return new Pair<Long, String>(id, contentUrl);
|
||||
}
|
||||
@@ -97,7 +101,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
{
|
||||
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
||||
contentUrlEntity.setId(id);
|
||||
contentUrlEntity = (ContentUrlEntity) template.queryForObject(SELECT_CONTENT_URL_BY_ID, contentUrlEntity);
|
||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_ID, contentUrlEntity);
|
||||
// Done
|
||||
return contentUrlEntity;
|
||||
}
|
||||
@@ -111,7 +115,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
{
|
||||
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
||||
}
|
||||
contentUrlEntity = (ContentUrlEntity) template.queryForObject(SELECT_CONTENT_URL_BY_KEY, contentUrlEntity);
|
||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_KEY, contentUrlEntity);
|
||||
// Done
|
||||
return contentUrlEntity;
|
||||
}
|
||||
@@ -126,9 +130,9 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
|
||||
ContentUrlOrphanQuery query = new ContentUrlOrphanQuery();
|
||||
query.setMaxOrphanTimeExclusive(maxOrphanTimeExclusive);
|
||||
List<ContentUrlEntity> results = template.queryForList(
|
||||
SELECT_CONTENT_URLS_ORPHANED,
|
||||
query, 0, maxResults);
|
||||
List<ContentUrlEntity> results = (List<ContentUrlEntity>) template.selectList(SELECT_CONTENT_URLS_ORPHANED,
|
||||
query,
|
||||
new RowBounds(0, maxResults));
|
||||
// Pass the result to the callback
|
||||
for (ContentUrlEntity result : results)
|
||||
{
|
||||
@@ -165,7 +169,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
{
|
||||
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
||||
}
|
||||
contentUrlEntity = (ContentUrlEntity) template.queryForObject(SELECT_CONTENT_URL_BY_KEY_UNREFERENCED, contentUrlEntity);
|
||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_KEY_UNREFERENCED, contentUrlEntity);
|
||||
// Done
|
||||
return contentUrlEntity;
|
||||
}
|
||||
@@ -200,7 +204,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||
params.put("id", id);
|
||||
ContentDataEntity contentDataEntity = (ContentDataEntity) template.queryForObject(SELECT_CONTENT_DATA_BY_ID, params);
|
||||
ContentDataEntity contentDataEntity = (ContentDataEntity) template.selectOne(SELECT_CONTENT_DATA_BY_ID, params);
|
||||
// Done
|
||||
return contentDataEntity;
|
||||
}
|
||||
@@ -247,7 +251,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
||||
idsEntity.setIdOne(nodeId);
|
||||
idsEntity.setIds(new ArrayList<Long>(qnameIds));
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Long> ids = (List<Long>) template.queryForList(SELECT_CONTENT_DATA_BY_NODE_AND_QNAME, idsEntity);
|
||||
List<Long> ids = (List<Long>) template.selectList(SELECT_CONTENT_DATA_BY_NODE_AND_QNAME, idsEntity);
|
||||
// Delete each one
|
||||
for (Long id : ids)
|
||||
{
|
||||
|
@@ -23,10 +23,7 @@ import java.sql.SQLException;
|
||||
import java.sql.Savepoint;
|
||||
|
||||
import org.alfresco.repo.domain.control.AbstractControlDAOImpl;
|
||||
import org.springframework.jdbc.datasource.DataSourceUtils;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.SqlMapClient;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific, DB-agnostic implementation for connection controlling DAO.
|
||||
@@ -37,13 +34,13 @@ import com.ibatis.sqlmap.client.SqlMapClient;
|
||||
public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
{
|
||||
/**
|
||||
* The iBatis-specific template for convenient statement execution.
|
||||
* The myBatis-specific template for convenient statement execution.
|
||||
*/
|
||||
protected SqlMapClientTemplate template;
|
||||
protected SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
public void startBatch()
|
||||
@@ -53,6 +50,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
* don't have any effect other than to let iBatis know that a batch
|
||||
* is possible.
|
||||
*/
|
||||
/*
|
||||
SqlMapClient sqlMapClient = template.getSqlMapClient();
|
||||
try
|
||||
{
|
||||
@@ -63,6 +61,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
{
|
||||
throw new RuntimeException("Failed to start DAO batch.", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void executeBatch()
|
||||
@@ -72,6 +71,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
* don't have any effect other than to let iBatis know that a batch
|
||||
* is possible.
|
||||
*/
|
||||
/*
|
||||
SqlMapClient sqlMapClient = template.getSqlMapClient();
|
||||
try
|
||||
{
|
||||
@@ -81,8 +81,9 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
throw new RuntimeException("Failed to start DAO batch.", e);
|
||||
throw new RuntimeException("Failed to execute DAO batch.", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +102,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection connection = DataSourceUtils.getConnection(template.getDataSource());
|
||||
Connection connection = template.getConnection();
|
||||
return connection.setSavepoint(savepoint);
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -117,7 +118,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection connection = DataSourceUtils.getConnection(template.getDataSource());
|
||||
Connection connection = template.getConnection();
|
||||
connection.rollback(savepoint);
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -130,7 +131,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection connection = DataSourceUtils.getConnection(template.getDataSource());
|
||||
Connection connection = template.getConnection();
|
||||
connection.releaseSavepoint(savepoint);
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -143,7 +144,7 @@ public class ControlDAOImpl extends AbstractControlDAOImpl
|
||||
@Override
|
||||
public int setTransactionIsolationLevel(int isolationLevel)
|
||||
{
|
||||
Connection connection = DataSourceUtils.getConnection(template.getDataSource());
|
||||
Connection connection = template.getConnection();
|
||||
if (connection == null)
|
||||
{
|
||||
throw new NullPointerException("There is no current connection");
|
||||
|
@@ -21,7 +21,7 @@ package org.alfresco.repo.domain.encoding.ibatis;
|
||||
import org.alfresco.repo.domain.encoding.AbstractEncodingDAOImpl;
|
||||
import org.alfresco.repo.domain.encoding.EncodingEntity;
|
||||
import org.alfresco.repo.domain.mimetype.MimetypeEntity;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the Mimetype DAO.
|
||||
@@ -33,21 +33,23 @@ public class EncodingDAOImpl extends AbstractEncodingDAOImpl
|
||||
{
|
||||
private static final String SELECT_ENCODING_BY_ID = "alfresco.content.select_EncodingById";
|
||||
private static final String SELECT_ENCODING_BY_KEY = "alfresco.content.select_EncodingByKey";
|
||||
private static final String INSERT_ENCODING = "alfresco.content.insert_Encoding";
|
||||
private static final String INSERT_ENCODING = "alfresco.content.insert.insert_Encoding";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected EncodingEntity getEncodingEntity(Long id)
|
||||
{
|
||||
EncodingEntity encodingEntity = new EncodingEntity();
|
||||
encodingEntity.setId(id);
|
||||
encodingEntity = (EncodingEntity) template.queryForObject(SELECT_ENCODING_BY_ID, encodingEntity);
|
||||
encodingEntity = (EncodingEntity) template.selectOne(SELECT_ENCODING_BY_ID, encodingEntity);
|
||||
// Done
|
||||
return encodingEntity;
|
||||
}
|
||||
@@ -57,7 +59,7 @@ public class EncodingDAOImpl extends AbstractEncodingDAOImpl
|
||||
{
|
||||
EncodingEntity encodingEntity = new EncodingEntity();
|
||||
encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
|
||||
encodingEntity = (EncodingEntity) template.queryForObject(SELECT_ENCODING_BY_KEY, encodingEntity);
|
||||
encodingEntity = (EncodingEntity) template.selectOne(SELECT_ENCODING_BY_KEY, encodingEntity);
|
||||
// Could be null
|
||||
return encodingEntity;
|
||||
}
|
||||
@@ -68,8 +70,7 @@ public class EncodingDAOImpl extends AbstractEncodingDAOImpl
|
||||
EncodingEntity encodingEntity = new EncodingEntity();
|
||||
encodingEntity.setVersion(MimetypeEntity.CONST_LONG_ZERO);
|
||||
encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
|
||||
Long id = (Long) template.insert(INSERT_ENCODING, encodingEntity);
|
||||
encodingEntity.setId(id);
|
||||
template.insert(INSERT_ENCODING, encodingEntity);
|
||||
// Done
|
||||
return encodingEntity;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.domain.locale.AbstractLocaleDAOImpl;
|
||||
import org.alfresco.repo.domain.locale.LocaleEntity;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the Locale DAO.
|
||||
@@ -35,22 +35,24 @@ public class LocaleDAOImpl extends AbstractLocaleDAOImpl
|
||||
{
|
||||
private static final String SELECT_LOCALE_BY_ID = "alfresco.locale.select_LocaleById";
|
||||
private static final String SELECT_LOCALE_BY_NAME = "alfresco.locale.select_LocaleByName";
|
||||
private static final String INSERT_LOCALE = "alfresco.locale.insert_Locale";
|
||||
private static final String INSERT_LOCALE = "alfresco.locale.insert.insert_Locale";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected LocaleEntity getLocaleEntity(Long id)
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", id);
|
||||
|
||||
return (LocaleEntity) template.queryForObject(SELECT_LOCALE_BY_ID, params);
|
||||
return (LocaleEntity) template.selectOne(SELECT_LOCALE_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +61,7 @@ public class LocaleDAOImpl extends AbstractLocaleDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("str", localeStr);
|
||||
|
||||
return (LocaleEntity) template.queryForObject(SELECT_LOCALE_BY_NAME, params);
|
||||
return (LocaleEntity) template.selectOne(SELECT_LOCALE_BY_NAME, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,8 +71,7 @@ public class LocaleDAOImpl extends AbstractLocaleDAOImpl
|
||||
localeEntity.setVersion(LocaleEntity.CONST_LONG_ZERO);
|
||||
localeEntity.setLocaleStr(localeStr);
|
||||
|
||||
Long id = (Long) template.insert(INSERT_LOCALE, localeEntity);
|
||||
localeEntity.setId(id);
|
||||
template.insert(INSERT_LOCALE, localeEntity);
|
||||
return localeEntity;
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,8 @@ import java.util.Map;
|
||||
import org.alfresco.repo.domain.locks.AbstractLockDAOImpl;
|
||||
import org.alfresco.repo.domain.locks.LockEntity;
|
||||
import org.alfresco.repo.domain.locks.LockResourceEntity;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the Locks DAO.
|
||||
@@ -39,25 +40,27 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
private static final String SELECT_LOCK_BY_ID = "alfresco.lock.select_LockByID";
|
||||
private static final String SELECT_LOCK_BY_KEY = "alfresco.lock.select_LockByKey";
|
||||
private static final String SELECT_LOCK_BY_SHARED_IDS = "alfresco.lock.select_LockBySharedIds";
|
||||
private static final String INSERT_LOCKRESOURCE = "alfresco.lock.insert_LockResource";
|
||||
private static final String INSERT_LOCK = "alfresco.lock.insert_Lock";
|
||||
private static final String INSERT_LOCKRESOURCE = "alfresco.lock.insert.insert_LockResource";
|
||||
private static final String INSERT_LOCK = "alfresco.lock.insert.insert_Lock";
|
||||
private static final String UPDATE_LOCK = "alfresco.lock.update_Lock";
|
||||
private static final String UPDATE_EXCLUSIVE_LOCK = "alfresco.lock.update_ExclusiveLock";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected LockResourceEntity getLockResource(Long qnameNamespaceId, String qnameLocalName)
|
||||
{
|
||||
LockResourceEntity lockResource = new LockResourceEntity();
|
||||
lockResource.setQnameNamespaceId(qnameNamespaceId);
|
||||
lockResource.setQnameLocalName(qnameLocalName == null ? null : qnameLocalName.toLowerCase());
|
||||
lockResource = (LockResourceEntity) template.queryForObject(SELECT_LOCKRESOURCE_BY_QNAME, lockResource);
|
||||
lockResource = (LockResourceEntity) template.selectOne(SELECT_LOCKRESOURCE_BY_QNAME, lockResource);
|
||||
// Could be null
|
||||
return lockResource;
|
||||
}
|
||||
@@ -69,8 +72,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
lockResource.setVersion(LockEntity.CONST_LONG_ZERO);
|
||||
lockResource.setQnameNamespaceId(qnameNamespaceId);
|
||||
lockResource.setQnameLocalName(qnameLocalName == null ? null : qnameLocalName.toLowerCase());
|
||||
Long id = (Long) template.insert(INSERT_LOCKRESOURCE, lockResource);
|
||||
lockResource.setId(id);
|
||||
template.insert(INSERT_LOCKRESOURCE, lockResource);
|
||||
// Done
|
||||
return lockResource;
|
||||
}
|
||||
@@ -79,7 +81,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
@Override
|
||||
protected List<LockEntity> getLocksBySharedResourceIds(List<Long> sharedLockResourceIds)
|
||||
{
|
||||
List<LockEntity> locks = template.queryForList(SELECT_LOCK_BY_SHARED_IDS, sharedLockResourceIds);
|
||||
List<LockEntity> locks = (List<LockEntity>) template.selectList(SELECT_LOCK_BY_SHARED_IDS, sharedLockResourceIds);
|
||||
// Done
|
||||
return locks;
|
||||
}
|
||||
@@ -89,7 +91,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
{
|
||||
LockEntity lock = new LockEntity();
|
||||
lock.setId(id);
|
||||
lock = (LockEntity) template.queryForObject(SELECT_LOCK_BY_ID, lock);
|
||||
lock = (LockEntity) template.selectOne(SELECT_LOCK_BY_ID, lock);
|
||||
// Done
|
||||
return lock;
|
||||
}
|
||||
@@ -100,7 +102,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
LockEntity lock = new LockEntity();
|
||||
lock.setSharedResourceId(sharedResourceId);
|
||||
lock.setExclusiveResourceId(exclusiveResourceId);
|
||||
lock = (LockEntity) template.queryForObject(SELECT_LOCK_BY_KEY, lock);
|
||||
lock = (LockEntity) template.selectOne(SELECT_LOCK_BY_KEY, lock);
|
||||
// Done
|
||||
return lock;
|
||||
}
|
||||
@@ -121,8 +123,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
long exp = now + timeToLive;
|
||||
lock.setStartTime(now);
|
||||
lock.setExpiryTime(exp);
|
||||
Long id = (Long) template.insert(INSERT_LOCK, lock);
|
||||
lock.setId(id);
|
||||
template.insert(INSERT_LOCK, lock);
|
||||
// Done
|
||||
return lock;
|
||||
}
|
||||
@@ -141,7 +142,14 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
||||
long exp = (timeToLive > 0) ? (now + timeToLive) : 0L;
|
||||
updateLockEntity.setStartTime(new Long(now));
|
||||
updateLockEntity.setExpiryTime(new Long(exp));
|
||||
template.update(UPDATE_LOCK, updateLockEntity, 1);
|
||||
|
||||
int updated = template.update(UPDATE_LOCK, updateLockEntity);
|
||||
if (updated != 1)
|
||||
{
|
||||
// unexpected number of rows affected
|
||||
throw new ConcurrencyFailureException("Incorrect number of rows affected for updateLock: " + updateLockEntity + ": expected 1, actual " + updated);
|
||||
}
|
||||
|
||||
// Done
|
||||
return updateLockEntity;
|
||||
}
|
||||
|
@@ -20,8 +20,8 @@ package org.alfresco.repo.domain.mimetype.ibatis;
|
||||
|
||||
import org.alfresco.repo.domain.mimetype.AbstractMimetypeDAOImpl;
|
||||
import org.alfresco.repo.domain.mimetype.MimetypeEntity;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the Mimetype DAO.
|
||||
@@ -33,22 +33,24 @@ public class MimetypeDAOImpl extends AbstractMimetypeDAOImpl
|
||||
{
|
||||
private static final String SELECT_MIMETYPE_BY_ID = "alfresco.content.select_MimetypeById";
|
||||
private static final String SELECT_MIMETYPE_BY_KEY = "alfresco.content.select_MimetypeByKey";
|
||||
private static final String INSERT_MIMETYPE = "alfresco.content.insert_Mimetype";
|
||||
private static final String INSERT_MIMETYPE = "alfresco.content.insert.insert_Mimetype";
|
||||
private static final String UPDATE_MIMETYPE = "alfresco.content.update_Mimetype";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected MimetypeEntity getMimetypeEntity(Long id)
|
||||
{
|
||||
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
||||
mimetypeEntity.setId(id);
|
||||
mimetypeEntity = (MimetypeEntity) template.queryForObject(SELECT_MIMETYPE_BY_ID, mimetypeEntity);
|
||||
mimetypeEntity = (MimetypeEntity) template.selectOne(SELECT_MIMETYPE_BY_ID, mimetypeEntity);
|
||||
// Done
|
||||
return mimetypeEntity;
|
||||
}
|
||||
@@ -58,7 +60,7 @@ public class MimetypeDAOImpl extends AbstractMimetypeDAOImpl
|
||||
{
|
||||
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
||||
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
|
||||
mimetypeEntity = (MimetypeEntity) template.queryForObject(SELECT_MIMETYPE_BY_KEY, mimetypeEntity);
|
||||
mimetypeEntity = (MimetypeEntity) template.selectOne(SELECT_MIMETYPE_BY_KEY, mimetypeEntity);
|
||||
// Could be null
|
||||
return mimetypeEntity;
|
||||
}
|
||||
@@ -69,8 +71,7 @@ public class MimetypeDAOImpl extends AbstractMimetypeDAOImpl
|
||||
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
||||
mimetypeEntity.setVersion(MimetypeEntity.CONST_LONG_ZERO);
|
||||
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
|
||||
Long id = (Long) template.insert(INSERT_MIMETYPE, mimetypeEntity);
|
||||
mimetypeEntity.setId(id);
|
||||
template.insert(INSERT_MIMETYPE, mimetypeEntity);
|
||||
// Done
|
||||
return mimetypeEntity;
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.node.ibatis;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -53,11 +52,12 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import com.sun.star.uno.RuntimeException;
|
||||
|
||||
/**
|
||||
* iBatis-specific extension of the Node abstract DAO
|
||||
@@ -68,17 +68,17 @@ import com.sun.star.uno.RuntimeException;
|
||||
public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
{
|
||||
private static final String SELECT_SERVER_BY_IPADDRESS = "alfresco.node.select_ServerByIpAddress";
|
||||
private static final String INSERT_SERVER = "alfresco.node.insert_Server";
|
||||
private static final String INSERT_TRANSACTION = "alfresco.node.insert_Transaction";
|
||||
private static final String INSERT_SERVER = "alfresco.node.insert.insert_Server";
|
||||
private static final String INSERT_TRANSACTION = "alfresco.node.insert.insert_Transaction";
|
||||
private static final String UPDATE_TRANSACTION_COMMIT_TIME = "alfresco.node.update_TransactionCommitTime";
|
||||
private static final String DELETE_TRANSACTION_BY_ID = "alfresco.node.delete_TransactionById";
|
||||
private static final String INSERT_STORE = "alfresco.node.insert_Store";
|
||||
private static final String INSERT_STORE = "alfresco.node.insert.insert_Store";
|
||||
private static final String UPDATE_STORE_ROOT = "alfresco.node.update_StoreRoot";
|
||||
private static final String UPDATE_STORE = "alfresco.node.update_Store";
|
||||
private static final String SELECT_STORE_ALL = "alfresco.node.select_StoreAll";
|
||||
private static final String SELECT_STORE_ROOT_NODE_BY_ID = "alfresco.node.select_StoreRootNodeById";
|
||||
private static final String SELECT_STORE_ROOT_NODE_BY_REF = "alfresco.node.select_StoreRootNodeByRef";
|
||||
private static final String INSERT_NODE = "alfresco.node.insert_Node";
|
||||
private static final String INSERT_NODE = "alfresco.node.insert.insert_Node";
|
||||
private static final String UPDATE_NODE = "alfresco.node.update_Node";
|
||||
private static final String UPDATE_NODE_PATCH_ACL = "alfresco.node.update_NodePatchAcl";
|
||||
private static final String DELETE_NODE_BY_ID = "alfresco.node.delete_NodeById";
|
||||
@@ -88,20 +88,20 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
private static final String SELECT_NODES_BY_UUIDS = "alfresco.node.select_NodesByUuids";
|
||||
private static final String SELECT_NODE_PROPERTIES = "alfresco.node.select_NodeProperties";
|
||||
private static final String SELECT_NODE_ASPECTS = "alfresco.node.select_NodeAspects";
|
||||
private static final String INSERT_NODE_PROPERTY = "alfresco.node.insert_NodeProperty";
|
||||
private static final String UPDATE_PRIMARY_CHILDREN_SHARED_ACL = "alfresco.node.update_PrimaryChildrenSharedAcl";
|
||||
private static final String INSERT_NODE_ASPECT = "alfresco.node.insert_NodeAspect";
|
||||
private static final String INSERT_NODE_PROPERTY = "alfresco.node.insert.insert_NodeProperty";
|
||||
private static final String UPDATE_PRIMARY_CHILDREN_SHARED_ACL = "alfresco.node.update.update_PrimaryChildrenSharedAcl";
|
||||
private static final String INSERT_NODE_ASPECT = "alfresco.node.insert.insert_NodeAspect";
|
||||
private static final String DELETE_NODE_ASPECTS = "alfresco.node.delete_NodeAspects";
|
||||
private static final String DELETE_NODE_PROPERTIES = "alfresco.node.delete_NodeProperties";
|
||||
private static final String SELECT_NODES_WITH_ASPECT_ID = "alfresco.node.select_NodesWithAspectId";
|
||||
private static final String INSERT_NODE_ASSOC = "alfresco.node.insert_NodeAssoc";
|
||||
private static final String INSERT_NODE_ASSOC = "alfresco.node.insert.insert_NodeAssoc";
|
||||
private static final String DELETE_NODE_ASSOC = "alfresco.node.delete_NodeAssoc";
|
||||
private static final String DELETE_NODE_ASSOCS_TO_AND_FROM = "alfresco.node.delete_NodeAssocsToAndFrom";
|
||||
private static final String SELECT_NODE_ASSOCS_BY_SOURCE = "alfresco.node.select_NodeAssocsBySource";
|
||||
private static final String SELECT_NODE_ASSOCS_BY_TARGET = "alfresco.node.select_NodeAssocsByTarget";
|
||||
private static final String SELECT_NODE_ASSOC_BY_ID = "alfresco.node.select_NodeAssocById";
|
||||
private static final String SELECT_NODE_PRIMARY_CHILD_ACLS = "alfresco.node.select_NodePrimaryChildAcls";
|
||||
private static final String INSERT_CHILD_ASSOC = "alfresco.node.insert_ChildAssoc";
|
||||
private static final String INSERT_CHILD_ASSOC = "alfresco.node.insert.insert_ChildAssoc";
|
||||
private static final String DELETE_CHILD_ASSOC_BY_ID = "alfresco.node.delete_ChildAssocById";
|
||||
private static final String UPDATE_CHILD_ASSOCS_INDEX = "alfresco.node.update_ChildAssocsIndex";
|
||||
private static final String UPDATE_CHILD_ASSOCS_UNIQUE_NAME = "alfresco.node.update_ChildAssocsUniqueName";
|
||||
@@ -122,13 +122,14 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
private static final String SELECT_TXN_MIN_COMMIT_TIME = "alfresco.node.select_TxnMinCommitTime";
|
||||
private static final String SELECT_TXN_MAX_COMMIT_TIME = "alfresco.node.select_TxnMaxCommitTime";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private QNameDAO qnameDAO;
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,6 +148,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
|
||||
public void startBatch()
|
||||
{
|
||||
// TODO
|
||||
/*
|
||||
try
|
||||
{
|
||||
template.getSqlMapClient().startBatch();
|
||||
@@ -155,10 +158,13 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
{
|
||||
throw new RuntimeException("Failed to start DAO batch.", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void executeBatch()
|
||||
{
|
||||
// TODO
|
||||
/*
|
||||
try
|
||||
{
|
||||
template.getSqlMapClient().executeBatch();
|
||||
@@ -167,6 +173,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
{
|
||||
throw new RuntimeException("Failed to start DAO batch.", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -176,7 +183,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
ServerEntity entity = new ServerEntity();
|
||||
entity.setIpAddress(ipAddress);
|
||||
// Potentially more results if there is a case issue (unlikely)
|
||||
List<ServerEntity> results = template.queryForList(SELECT_SERVER_BY_IPADDRESS, entity);
|
||||
List<ServerEntity> results = (List<ServerEntity>) template.selectList(SELECT_SERVER_BY_IPADDRESS, entity);
|
||||
for (ServerEntity serverEntity : results)
|
||||
{
|
||||
// Take the first one that matches regardless of case
|
||||
@@ -195,7 +202,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
ServerEntity entity = new ServerEntity();
|
||||
entity.setVersion(1L);
|
||||
entity.setIpAddress(ipAddress);
|
||||
return (Long) template.insert(INSERT_SERVER, entity);
|
||||
template.insert(INSERT_SERVER, entity);
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,7 +216,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
transaction.setVersion(1L);
|
||||
transaction.setChangeTxnId(changeTxnId);
|
||||
transaction.setCommitTimeMs(commitTimeMs);
|
||||
return (Long) template.insert(INSERT_TRANSACTION, transaction);
|
||||
template.insert(INSERT_TRANSACTION, transaction);
|
||||
return transaction.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -232,7 +241,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
@Override
|
||||
protected List<StoreEntity> selectAllStores()
|
||||
{
|
||||
return template.queryForList(SELECT_STORE_ALL);
|
||||
return (List<StoreEntity>) template.selectList(SELECT_STORE_ALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -240,7 +249,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
{
|
||||
StoreEntity store = new StoreEntity();
|
||||
store.setId(storeId);
|
||||
return (NodeEntity) template.queryForObject(SELECT_STORE_ROOT_NODE_BY_ID, store);
|
||||
return (NodeEntity) template.selectOne(SELECT_STORE_ROOT_NODE_BY_ID, store);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,14 +258,15 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
StoreEntity store = new StoreEntity();
|
||||
store.setProtocol(storeRef.getProtocol());
|
||||
store.setIdentifier(storeRef.getIdentifier());
|
||||
return (NodeEntity) template.queryForObject(SELECT_STORE_ROOT_NODE_BY_REF, store);
|
||||
return (NodeEntity) template.selectOne(SELECT_STORE_ROOT_NODE_BY_REF, store);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Long insertStore(StoreEntity store)
|
||||
{
|
||||
store.setVersion(1L);
|
||||
return (Long) template.insert(INSERT_STORE, store);
|
||||
template.insert(INSERT_STORE, store);
|
||||
return store.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,7 +285,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
protected Long insertNode(NodeEntity node)
|
||||
{
|
||||
node.setVersion(1L);
|
||||
return (Long) template.insert(INSERT_NODE, node);
|
||||
template.insert(INSERT_NODE, node);
|
||||
return node.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -336,7 +347,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
node.setDeleted(deleted);
|
||||
}
|
||||
|
||||
return (NodeEntity) template.queryForObject(SELECT_NODE_BY_ID, node);
|
||||
return (NodeEntity) template.selectOne(SELECT_NODE_BY_ID, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -363,7 +374,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
node.setDeleted(deleted);
|
||||
}
|
||||
|
||||
return (NodeEntity) template.queryForObject(SELECT_NODE_BY_NODEREF, node);
|
||||
return (NodeEntity) template.selectOne(SELECT_NODE_BY_NODEREF, node);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -374,7 +385,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
nodeBatchLoadEntity.setStoreId(storeId);
|
||||
nodeBatchLoadEntity.setUuids(new ArrayList<String>(uuids));
|
||||
|
||||
return (List<NodeEntity>) template.queryForList(SELECT_NODES_BY_UUIDS, nodeBatchLoadEntity);
|
||||
return (List<NodeEntity>) template.selectList(SELECT_NODES_BY_UUIDS, nodeBatchLoadEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,7 +442,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
NodeAspectsEntity aspects = new NodeAspectsEntity();
|
||||
aspects.setNodeIds(new ArrayList<Long>(nodeIds));
|
||||
|
||||
List<NodeAspectsEntity> rows = template.queryForList(SELECT_NODE_ASPECTS, aspects);
|
||||
List<NodeAspectsEntity> rows = (List<NodeAspectsEntity>) template.selectList(SELECT_NODE_ASPECTS, aspects);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@@ -446,7 +457,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
NodePropertyEntity prop = new NodePropertyEntity();
|
||||
prop.setNodeIds(new ArrayList<Long>(nodeIds));
|
||||
|
||||
List<NodePropertyEntity> rows = template.queryForList(SELECT_NODE_PROPERTIES, prop);
|
||||
List<NodePropertyEntity> rows = (List<NodePropertyEntity>) template.selectList(SELECT_NODE_PROPERTIES, prop);
|
||||
return makePersistentPropertiesMap(rows);
|
||||
}
|
||||
@Override
|
||||
@@ -475,7 +486,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
prop.setQnameIds(new ArrayList<Long>(qnameIds));
|
||||
}
|
||||
|
||||
List<NodePropertyEntity> rows = template.queryForList(SELECT_NODE_PROPERTIES, prop);
|
||||
List<NodePropertyEntity> rows = (List<NodePropertyEntity>) template.selectList(SELECT_NODE_PROPERTIES, prop);
|
||||
Map<Long, Map<NodePropertyKey, NodePropertyValue>> results = makePersistentPropertiesMap(rows);
|
||||
Map<NodePropertyKey, NodePropertyValue> props = results.get(nodeId);
|
||||
if (props == null)
|
||||
@@ -602,11 +613,11 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
@Override
|
||||
protected void selectNodesWithAspect(Long qnameId, Long minNodeId, final NodeRefQueryCallback resultsCallback)
|
||||
{
|
||||
RowHandler rowHandler = new RowHandler()
|
||||
ResultHandler resultHandler = new ResultHandler()
|
||||
{
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
NodeEntity entity = (NodeEntity) valueObject;
|
||||
NodeEntity entity = (NodeEntity) context.getResultObject();
|
||||
Pair<Long, NodeRef> nodePair = new Pair<Long, NodeRef>(entity.getId(), entity.getNodeRef());
|
||||
resultsCallback.handle(nodePair);
|
||||
}
|
||||
@@ -615,7 +626,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
Map<String, Long> parameters = new HashMap<String, Long>(5);
|
||||
parameters.put("minNodeId", minNodeId);
|
||||
parameters.put("qnameId", qnameId);
|
||||
template.queryWithRowHandler(SELECT_NODES_WITH_ASPECT_ID, parameters,rowHandler);
|
||||
template.select(SELECT_NODES_WITH_ASPECT_ID, parameters,resultHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -633,7 +644,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
targetNode.setId(targetNodeId);
|
||||
assoc.setTargetNode(targetNode);
|
||||
|
||||
return (Long) template.insert(INSERT_NODE_ASSOC, assoc);
|
||||
template.insert(INSERT_NODE_ASSOC, assoc);
|
||||
return assoc.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -696,7 +708,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
sourceNode.setId(sourceNodeId);
|
||||
assoc.setSourceNode(sourceNode);
|
||||
|
||||
return (List<NodeAssocEntity>) template.queryForList(SELECT_NODE_ASSOCS_BY_SOURCE, assoc);
|
||||
return (List<NodeAssocEntity>) template.selectList(SELECT_NODE_ASSOCS_BY_SOURCE, assoc);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -709,7 +721,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
targetNode.setId(targetNodeId);
|
||||
assoc.setTargetNode(targetNode);
|
||||
|
||||
return (List<NodeAssocEntity>) template.queryForList(SELECT_NODE_ASSOCS_BY_TARGET, assoc);
|
||||
return (List<NodeAssocEntity>) template.selectList(SELECT_NODE_ASSOCS_BY_TARGET, assoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -718,14 +730,15 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
NodeAssocEntity assoc = new NodeAssocEntity();
|
||||
assoc.setId(assocId);
|
||||
|
||||
return (NodeAssocEntity) template.queryForObject(SELECT_NODE_ASSOC_BY_ID, assoc);
|
||||
return (NodeAssocEntity) template.selectOne(SELECT_NODE_ASSOC_BY_ID, assoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Long insertChildAssoc(ChildAssocEntity assoc)
|
||||
{
|
||||
assoc.setVersion(1L);
|
||||
return (Long) template.insert(INSERT_CHILD_ASSOC, assoc);
|
||||
template.insert(INSERT_CHILD_ASSOC, assoc);
|
||||
return assoc.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -801,7 +814,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
ChildAssocEntity assoc = new ChildAssocEntity();
|
||||
assoc.setId(assocId);
|
||||
|
||||
return (ChildAssocEntity) template.queryForObject(SELECT_CHILD_ASSOC_BY_ID, assoc);
|
||||
return (ChildAssocEntity) template.selectOne(SELECT_CHILD_ASSOC_BY_ID, assoc);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -816,7 +829,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
// Primary
|
||||
assoc.setPrimary(true);
|
||||
|
||||
return template.queryForList(SELECT_NODE_PRIMARY_CHILD_ACLS, assoc);
|
||||
return (List<NodeIdAndAclId>) template.selectList(SELECT_NODE_PRIMARY_CHILD_ACLS, assoc);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -847,16 +860,16 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
return Collections.emptyList(); // Shortcut
|
||||
}
|
||||
|
||||
return template.queryForList(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
||||
return (List<ChildAssocEntity>) template.selectList(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter to allow the {@link ChildAssocRowHandler} to filter results.
|
||||
* Filter to allow the {@link ChildAssocResultHandler} to filter results.
|
||||
*
|
||||
* @author Derek Hulley
|
||||
* @since 3.4
|
||||
*/
|
||||
private interface ChildAssocRowHandlerFilter
|
||||
private interface ChildAssocResultHandlerFilter
|
||||
{
|
||||
boolean isResult(ChildAssocEntity assoc);
|
||||
}
|
||||
@@ -867,24 +880,24 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
* @author Derek Hulley
|
||||
* @since 3.4
|
||||
*/
|
||||
private class ChildAssocRowHandler implements RowHandler
|
||||
private class ChildAssocResultHandler implements ResultHandler
|
||||
{
|
||||
private final ChildAssocRowHandlerFilter filter;
|
||||
private final ChildAssocResultHandlerFilter filter;
|
||||
private final ChildAssocRefQueryCallback resultsCallback;
|
||||
private boolean more = true;
|
||||
|
||||
private ChildAssocRowHandler(ChildAssocRefQueryCallback resultsCallback)
|
||||
private ChildAssocResultHandler(ChildAssocRefQueryCallback resultsCallback)
|
||||
{
|
||||
this(null, resultsCallback);
|
||||
}
|
||||
|
||||
private ChildAssocRowHandler(ChildAssocRowHandlerFilter filter, ChildAssocRefQueryCallback resultsCallback)
|
||||
private ChildAssocResultHandler(ChildAssocResultHandlerFilter filter, ChildAssocRefQueryCallback resultsCallback)
|
||||
{
|
||||
this.filter = filter;
|
||||
this.resultsCallback = resultsCallback;
|
||||
}
|
||||
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
// Do nothing if no further results are required
|
||||
// TODO: Use iBatis' new feature (when we upgrade) to kill the resultset walking
|
||||
@@ -892,7 +905,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
{
|
||||
return;
|
||||
}
|
||||
ChildAssocEntity assoc = (ChildAssocEntity) valueObject;
|
||||
ChildAssocEntity assoc = (ChildAssocEntity) context.getResultObject();
|
||||
if (filter != null && !filter.isResult(assoc))
|
||||
{
|
||||
// Filtered out
|
||||
@@ -959,8 +972,12 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
assoc.setSameStore(sameStore);
|
||||
}
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
|
||||
// TODO MyBatis workaround - see also http://code.google.com/p/mybatis/issues/detail?id=58 (and #139, #234, ...)
|
||||
template.clearCache();
|
||||
template.select(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, resultHandler);
|
||||
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -983,8 +1000,12 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
}
|
||||
assoc.setTypeQNameIds(new ArrayList<Long>(assocTypeQNameIds));
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
|
||||
// TODO MyBatis workaround - see also http://code.google.com/p/mybatis/issues/detail?id=58 (and #139, #234, ...)
|
||||
template.clearCache();
|
||||
template.select(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, resultHandler);
|
||||
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -1005,7 +1026,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
assoc.setChildNodeNameAll(null, assocTypeQName, childName);
|
||||
|
||||
// Note: This single results was assumed from inception of the original method. It's correct.
|
||||
return (ChildAssocEntity) template.queryForObject(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
||||
return (ChildAssocEntity) template.selectOne(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1035,7 +1056,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
childNamesCrc.add(childNameCrc);
|
||||
}
|
||||
// Create a filter that checks that the name CRC is present
|
||||
ChildAssocRowHandlerFilter filter = new ChildAssocRowHandlerFilter()
|
||||
ChildAssocResultHandlerFilter filter = new ChildAssocResultHandlerFilter()
|
||||
{
|
||||
public boolean isResult(ChildAssocEntity assoc)
|
||||
{
|
||||
@@ -1059,8 +1080,12 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
// Child names
|
||||
assoc.setChildNodeNameCrcs(childNamesCrc);
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(filter, resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(filter, resultsCallback);
|
||||
|
||||
// TODO MyBatis workaround - see also http://code.google.com/p/mybatis/issues/detail?id=58 (and #139, #234, ...)
|
||||
template.clearCache();
|
||||
template.select(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, resultHandler);
|
||||
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -1083,8 +1108,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
}
|
||||
assoc.setChildNodeTypeQNameIds(new ArrayList<Long>(childNodeTypeQNameIds));
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
template.select(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, resultHandler);
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -1105,8 +1130,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
return; // Shortcut
|
||||
}
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_OF_PARENT_WITHOUT_PARENT_ASSOCS_OF_TYPE, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
template.select(SELECT_CHILD_ASSOCS_OF_PARENT_WITHOUT_PARENT_ASSOCS_OF_TYPE, assoc, resultHandler);
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -1122,7 +1147,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
// Primary
|
||||
assoc.setPrimary(Boolean.TRUE);
|
||||
|
||||
return template.queryForList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||
return (List<ChildAssocEntity>) template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1160,8 +1185,12 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
assoc.setPrimary(isPrimary);
|
||||
}
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_PARENT_ASSOCS_OF_CHILD, assoc, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
|
||||
// TODO MyBatis workaround - see also http://code.google.com/p/mybatis/issues/detail?id=58 (and #139, #234, ...)
|
||||
template.clearCache();
|
||||
template.select(SELECT_PARENT_ASSOCS_OF_CHILD, assoc, resultHandler);
|
||||
|
||||
resultsCallback.done();
|
||||
}
|
||||
|
||||
@@ -1175,7 +1204,9 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
childNode.setId(childNodeId);
|
||||
assoc.setChildNode(childNode);
|
||||
|
||||
return template.queryForList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||
// TODO MyBatis workaround - see also http://code.google.com/p/mybatis/issues/detail?id=58 (and #139, #234, ...)
|
||||
template.clearCache();
|
||||
return (List<ChildAssocEntity>) template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1222,7 +1253,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
TransactionQueryEntity query = new TransactionQueryEntity();
|
||||
query.setMaxCommitTime(maxCommitTime);
|
||||
|
||||
List<Transaction> txns = template.queryForList(SELECT_TXN_LAST, query, 0, 1);
|
||||
List<Transaction> txns = (List<Transaction>) template.selectList(SELECT_TXN_LAST, query, new RowBounds(0, 1));
|
||||
if (txns.size() > 0)
|
||||
{
|
||||
return txns.get(0);
|
||||
@@ -1236,7 +1267,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
@Override
|
||||
protected int selectTransactionCount()
|
||||
{
|
||||
return (Integer) template.queryForObject(SELECT_TXN_COUNT);
|
||||
return (Integer) template.selectOne(SELECT_TXN_COUNT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1245,7 +1276,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
TransactionQueryEntity query = new TransactionQueryEntity();
|
||||
query.setId(txnId);
|
||||
|
||||
return (Transaction) template.queryForObject(SELECT_TXNS, query);
|
||||
return (Transaction) template.selectOne(SELECT_TXNS, query);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -1260,7 +1291,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
}
|
||||
|
||||
// TODO: Return List<Node> for quicker node_deleted access
|
||||
return (List<NodeEntity>) template.queryForList(SELECT_TXN_NODES, query);
|
||||
return (List<NodeEntity>) template.selectList(SELECT_TXN_NODES, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1277,7 +1308,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
transaction.setId(txnId);
|
||||
node.setTransaction(transaction);
|
||||
|
||||
return (Integer) template.queryForObject(SELECT_TXN_NODE_COUNT, node);
|
||||
return (Integer) template.selectOne(SELECT_TXN_NODE_COUNT, node);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -1294,18 +1325,27 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
TransactionQueryEntity query = new TransactionQueryEntity();
|
||||
query.setMinCommitTime(fromTimeInclusive);
|
||||
query.setMaxCommitTime(toTimeExclusive);
|
||||
query.setIncludeTxnIds(includeTxnIds);
|
||||
query.setExcludeTxnIds(excludeTxnIds);
|
||||
|
||||
if ((includeTxnIds != null) && (includeTxnIds.size() > 0))
|
||||
{
|
||||
query.setIncludeTxnIds(includeTxnIds);
|
||||
}
|
||||
|
||||
if ((excludeTxnIds != null) && (excludeTxnIds.size() > 0))
|
||||
{
|
||||
query.setExcludeTxnIds(excludeTxnIds);
|
||||
}
|
||||
|
||||
query.setExcludeServerId(excludeServerId);
|
||||
query.setAscending(ascending);
|
||||
|
||||
if (count == null)
|
||||
{
|
||||
return template.queryForList(SELECT_TXNS, query);
|
||||
return (List<Transaction>) template.selectList(SELECT_TXNS, query);
|
||||
}
|
||||
else
|
||||
{
|
||||
return template.queryForList(SELECT_TXNS, query, 0, count);
|
||||
return (List<Transaction>) template.selectList(SELECT_TXNS, query, new RowBounds(0, count));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1318,24 +1358,24 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
query.setMaxCommitTime(maxCommitTime);
|
||||
if (count == null)
|
||||
{
|
||||
return template.queryForList(SELECT_TXNS_UNUSED, query);
|
||||
return (List<Long>) template.selectList(SELECT_TXNS_UNUSED, query);
|
||||
}
|
||||
else
|
||||
{
|
||||
return template.queryForList(SELECT_TXNS_UNUSED, query, 0, count);
|
||||
return (List<Long>) template.selectList(SELECT_TXNS_UNUSED, query, new RowBounds(0, count));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Long selectMinTxnCommitTime()
|
||||
{
|
||||
return (Long) template.queryForObject(SELECT_TXN_MIN_COMMIT_TIME);
|
||||
return (Long) template.selectOne(SELECT_TXN_MIN_COMMIT_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Long selectMaxTxnCommitTime()
|
||||
{
|
||||
return (Long) template.queryForObject(SELECT_TXN_MAX_COMMIT_TIME);
|
||||
return (Long) template.selectOne(SELECT_TXN_MAX_COMMIT_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1358,8 +1398,8 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
assocProp.setValue(nodeValue);
|
||||
assocProp.setPropertyQNameId(propName.getFirst());
|
||||
|
||||
ChildAssocRowHandler rowHandler = new ChildAssocRowHandler(resultsCallback);
|
||||
template.queryWithRowHandler(SELECT_CHILD_ASSOCS_BY_PROPERTY_VALUE, assocProp, rowHandler);
|
||||
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
|
||||
template.select(SELECT_CHILD_ASSOCS_BY_PROPERTY_VALUE, assocProp, resultHandler);
|
||||
resultsCallback.done();
|
||||
}
|
||||
}
|
||||
|
@@ -25,8 +25,7 @@ import org.alfresco.ibatis.BatchingDAO;
|
||||
import org.alfresco.repo.domain.avm.AVMNodeEntity;
|
||||
import org.alfresco.repo.domain.contentdata.ContentDataDAO;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
|
||||
|
||||
/**
|
||||
@@ -218,36 +217,36 @@ public abstract class AbstractPatchDAOImpl implements PatchDAO, BatchingDAO
|
||||
protected abstract int deleteAclMemberEntitiesForAcls(List<Long> aclIds);
|
||||
|
||||
// note: caller's row handler is expected to migrate the attrs
|
||||
public void migrateOldAttrTenants(RowHandler rowHandler)
|
||||
public void migrateOldAttrTenants(ResultHandler resultHandler)
|
||||
{
|
||||
getOldAttrTenantsImpl(rowHandler);
|
||||
getOldAttrTenantsImpl(resultHandler);
|
||||
}
|
||||
|
||||
protected abstract void getOldAttrTenantsImpl(RowHandler rowHandler);
|
||||
protected abstract void getOldAttrTenantsImpl(ResultHandler resultHandler);
|
||||
|
||||
// note: caller's row handler is expected to migrate the attrs
|
||||
public void migrateOldAttrAVMLocks(RowHandler rowHandler)
|
||||
public void migrateOldAttrAVMLocks(ResultHandler resultHandler)
|
||||
{
|
||||
getOldAttrAVMLocksImpl(rowHandler);
|
||||
getOldAttrAVMLocksImpl(resultHandler);
|
||||
}
|
||||
|
||||
protected abstract void getOldAttrAVMLocksImpl(RowHandler rowHandler);
|
||||
protected abstract void getOldAttrAVMLocksImpl(ResultHandler resultHandler);
|
||||
|
||||
// note: caller's row handler is expected to migrate the attrs
|
||||
public void migrateOldAttrPropertyBackedBeans(RowHandler rowHandler)
|
||||
public void migrateOldAttrPropertyBackedBeans(ResultHandler resultHandler)
|
||||
{
|
||||
getOldAttrPropertyBackedBeansImpl(rowHandler);
|
||||
getOldAttrPropertyBackedBeansImpl(resultHandler);
|
||||
}
|
||||
|
||||
protected abstract void getOldAttrPropertyBackedBeansImpl(RowHandler rowHandler);
|
||||
protected abstract void getOldAttrPropertyBackedBeansImpl(ResultHandler resultHandler);
|
||||
|
||||
// note: caller's row handler is expected to migrate the attrs
|
||||
public void migrateOldAttrChainingURS(RowHandler rowHandler)
|
||||
public void migrateOldAttrChainingURS(ResultHandler resultHandler)
|
||||
{
|
||||
getOldAttrChainingURSImpl(rowHandler);
|
||||
getOldAttrChainingURSImpl(resultHandler);
|
||||
}
|
||||
|
||||
protected abstract void getOldAttrChainingURSImpl(RowHandler rowHandler);
|
||||
protected abstract void getOldAttrChainingURSImpl(ResultHandler resultHandler);
|
||||
|
||||
public List<String> getOldAttrCustomNames()
|
||||
{
|
||||
|
@@ -27,8 +27,7 @@ import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
|
||||
/**
|
||||
* Additional DAO services for patches
|
||||
@@ -187,22 +186,22 @@ public interface PatchDAO
|
||||
/**
|
||||
* Migrate old Tenant attributes (if any)
|
||||
*/
|
||||
public void migrateOldAttrTenants(RowHandler rowHandler);
|
||||
public void migrateOldAttrTenants(ResultHandler resultHandler);
|
||||
|
||||
/**
|
||||
* Migrate old AVM Lock attributes (if any)
|
||||
*/
|
||||
public void migrateOldAttrAVMLocks(RowHandler rowHandler);
|
||||
public void migrateOldAttrAVMLocks(ResultHandler resultHandler);
|
||||
|
||||
/**
|
||||
* Migrate old Property-Backed Bean attributes (if any)
|
||||
*/
|
||||
public void migrateOldAttrPropertyBackedBeans(RowHandler rowHandler);
|
||||
public void migrateOldAttrPropertyBackedBeans(ResultHandler resultHandler);
|
||||
|
||||
/**
|
||||
* Migrate old Chaining User Registry Synchronizer attributes (if any)
|
||||
*/
|
||||
public void migrateOldAttrChainingURS(RowHandler rowHandler);
|
||||
public void migrateOldAttrChainingURS(ResultHandler resultHandler);
|
||||
|
||||
/**
|
||||
* Get custom global attribute names (if any)
|
||||
|
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.repo.domain.patch.AbstractAppliedPatchDAOImpl;
|
||||
import org.alfresco.repo.domain.patch.AppliedPatchEntity;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AppliedPatch DAO.
|
||||
@@ -37,13 +37,15 @@ public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
|
||||
private static final String SELECT_APPLIED_PATCH_BY_ID = "alfresco.appliedpatch.select_AppliedPatchById";
|
||||
private static final String SELECT_ALL_APPLIED_PATCH = "alfresco.appliedpatch.select_AllAppliedPatches";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void createAppliedPatchEntity(AppliedPatchEntity entity)
|
||||
{
|
||||
@@ -60,7 +62,7 @@ public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
|
||||
{
|
||||
AppliedPatchEntity entity = new AppliedPatchEntity();
|
||||
entity.setId(id);
|
||||
entity = (AppliedPatchEntity) template.queryForObject(SELECT_APPLIED_PATCH_BY_ID, entity);
|
||||
entity = (AppliedPatchEntity) template.selectOne(SELECT_APPLIED_PATCH_BY_ID, entity);
|
||||
// Could be null
|
||||
return entity;
|
||||
}
|
||||
@@ -69,10 +71,9 @@ public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
|
||||
@Override
|
||||
protected List<AppliedPatchEntity> getAppliedPatchEntities()
|
||||
{
|
||||
return (List<AppliedPatchEntity>) template.queryForList(SELECT_ALL_APPLIED_PATCH);
|
||||
return (List<AppliedPatchEntity>) template.selectList(SELECT_ALL_APPLIED_PATCH);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// @Override
|
||||
// protected EncodingEntity getEncodingEntity(Long id)
|
||||
|
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.patch.ibatis;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -39,10 +38,10 @@ import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import com.ibatis.sqlmap.engine.execution.SqlExecutor;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the AVMPatch DAO.
|
||||
@@ -101,15 +100,18 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
private static final String SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT = "alfresco.patch.select_sharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent";
|
||||
private static final String SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL = "alfresco.patch.select_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private QNameDAO qnameDAO;
|
||||
private LocaleDAO localeDAO;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
private QNameDAO qnameDAO;
|
||||
|
||||
public void setQnameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
this.qnameDAO = qnameDAO;
|
||||
@@ -122,6 +124,8 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
|
||||
public void startBatch()
|
||||
{
|
||||
// TODO
|
||||
/*
|
||||
try
|
||||
{
|
||||
template.getSqlMapClient().startBatch();
|
||||
@@ -130,10 +134,13 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
throw new RuntimeException("Failed to start batch", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void executeBatch()
|
||||
{
|
||||
// TODO
|
||||
/*
|
||||
try
|
||||
{
|
||||
template.getSqlMapClient().executeBatch();
|
||||
@@ -142,12 +149,13 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
throw new RuntimeException("Failed to start batch", e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long getAVMNodeEntitiesCountWhereNewInStore()
|
||||
{
|
||||
Long count = (Long) template.queryForObject(SELECT_AVM_NODE_ENTITIES_COUNT_WHERE_NEW_IN_STORE);
|
||||
Long count = (Long) template.selectOne(SELECT_AVM_NODE_ENTITIES_COUNT_WHERE_NEW_IN_STORE);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@@ -157,10 +165,10 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
if (maxResults < 0)
|
||||
{
|
||||
maxResults = SqlExecutor.NO_MAXIMUM_RESULTS;
|
||||
maxResults = RowBounds.NO_ROW_LIMIT;
|
||||
}
|
||||
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODE_ENTITIES_WITH_EMPTY_GUID, 0, maxResults);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_NODE_ENTITIES_WITH_EMPTY_GUID, new RowBounds(0, maxResults));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -169,10 +177,10 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
if (maxResults < 0)
|
||||
{
|
||||
maxResults = SqlExecutor.NO_MAXIMUM_RESULTS;
|
||||
maxResults = RowBounds.NO_ROW_LIMIT;
|
||||
}
|
||||
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_LD_NODE_ENTITIES_NULL_VERSION, 0, maxResults);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_LD_NODE_ENTITIES_NULL_VERSION, new RowBounds(0, maxResults));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -181,15 +189,15 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
if (maxResults < 0)
|
||||
{
|
||||
maxResults = SqlExecutor.NO_MAXIMUM_RESULTS;
|
||||
maxResults = RowBounds.NO_ROW_LIMIT;
|
||||
}
|
||||
|
||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_LF_NODE_ENTITIES_NULL_VERSION, 0, maxResults);
|
||||
return (List<AVMNodeEntity>) template.selectList(SELECT_AVM_LF_NODE_ENTITIES_NULL_VERSION, new RowBounds(0, maxResults));
|
||||
}
|
||||
|
||||
public long getMaxAvmNodeID()
|
||||
{
|
||||
Long count = (Long) template.queryForObject(SELECT_AVM_MAX_NODE_ID);
|
||||
Long count = (Long) template.selectOne(SELECT_AVM_MAX_NODE_ID);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@@ -199,12 +207,12 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
IdsEntity ids = new IdsEntity();
|
||||
ids.setIdOne(minNodeId);
|
||||
ids.setIdTwo(maxNodeId);
|
||||
return (List<Long>) template.queryForList(SELECT_AVM_NODES_WITH_OLD_CONTENT_PROPERTIES, ids);
|
||||
return (List<Long>) template.selectList(SELECT_AVM_NODES_WITH_OLD_CONTENT_PROPERTIES, ids);
|
||||
}
|
||||
|
||||
public long getMaxAdmNodeID()
|
||||
{
|
||||
Long count = (Long) template.queryForObject(SELECT_ADM_MAX_NODE_ID);
|
||||
Long count = (Long) template.selectOne(SELECT_ADM_MAX_NODE_ID);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@@ -215,7 +223,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
IdsEntity ids = new IdsEntity();
|
||||
ids.setIdOne(minNodeId);
|
||||
ids.setIdTwo(maxNodeId);
|
||||
return (List<Map<String, Object>>) template.queryForList(SELECT_ADM_OLD_CONTENT_PROPERTIES, ids);
|
||||
return (List<Map<String, Object>>) template.selectList(SELECT_ADM_OLD_CONTENT_PROPERTIES, ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,14 +285,14 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
protected long getMaxAclEntityId()
|
||||
{
|
||||
Long count = (Long) template.queryForObject(SELECT_PERMISSIONS_MAX_ACL_ID, null);
|
||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_MAX_ACL_ID, null);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long getDmNodeEntitiesCount()
|
||||
{
|
||||
Long count = (Long) template.queryForObject(SELECT_PERMISSIONS_DM_NODE_COUNT, null);
|
||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT, null);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@@ -293,7 +301,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", above);
|
||||
Long count = (Long) template.queryForObject(SELECT_PERMISSIONS_DM_NODE_COUNT_WITH_NEW_ACLS, params);
|
||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT_WITH_NEW_ACLS, params);
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
@@ -301,14 +309,14 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
protected List<Long> selectAllAclEntityIds()
|
||||
{
|
||||
return (List<Long>) template.queryForList(SELECT_PERMISSIONS_ALL_ACL_IDS);
|
||||
return (List<Long>) template.selectList(SELECT_PERMISSIONS_ALL_ACL_IDS);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<Long> selectNonDanglingAclEntityIds()
|
||||
{
|
||||
return (List<Long>) template.queryForList(SELECT_PERMISSIONS_USED_ACL_IDS);
|
||||
return (List<Long>) template.selectList(SELECT_PERMISSIONS_USED_ACL_IDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -332,12 +340,12 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
public List<String> getAuthoritiesWithNonUtf8Crcs()
|
||||
{
|
||||
final List<String> results = new ArrayList<String>(1000);
|
||||
RowHandler rowHandler = new RowHandler()
|
||||
ResultHandler resultHandler = new ResultHandler()
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> result = (Map<String, Object>) valueObject;
|
||||
Map<String, Object> result = (Map<String, Object>) context.getResultObject();
|
||||
String authority = (String) result.get("authority");
|
||||
Long crc = (Long) result.get("crc");
|
||||
Long crcShouldBe = CrcHelper.getStringCrcPair(authority, 32, true, true).getSecond();
|
||||
@@ -348,20 +356,20 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
}
|
||||
}
|
||||
};
|
||||
template.queryWithRowHandler(SELECT_AUTHORITIES_AND_CRC, rowHandler);
|
||||
template.select(SELECT_AUTHORITIES_AND_CRC, resultHandler);
|
||||
// Done
|
||||
return results;
|
||||
}
|
||||
|
||||
public int getChildAssocCount()
|
||||
{
|
||||
return (Integer) template.queryForObject(SELECT_CHILD_ASSOCS_COUNT);
|
||||
return (Integer) template.selectOne(SELECT_CHILD_ASSOCS_COUNT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getMaxChildAssocId()
|
||||
{
|
||||
Long maxAssocId = (Long) template.queryForObject(SELECT_CHILD_ASSOCS_MAX_ID);
|
||||
Long maxAssocId = (Long) template.selectOne(SELECT_CHILD_ASSOCS_MAX_ID);
|
||||
return maxAssocId == null ? 0L : maxAssocId;
|
||||
}
|
||||
|
||||
@@ -400,7 +408,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
|
||||
try
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, 0, queryMaxResults);
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, new RowBounds(0, queryMaxResults));
|
||||
if (results.size() == 0 && rows.size() >= maxResults)
|
||||
{
|
||||
// We have all we need
|
||||
@@ -473,12 +481,12 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
params.put("namePattern", namePattern);
|
||||
|
||||
final List<Pair<NodeRef, String>> results = new ArrayList<Pair<NodeRef, String>>(500);
|
||||
RowHandler rowHandler = new RowHandler()
|
||||
ResultHandler resultHandler = new ResultHandler()
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object rowObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
Map<String, Object> row = (Map<String, Object>) rowObject;
|
||||
Map<String, Object> row = (Map<String, Object>) context.getResultObject();
|
||||
String protocol = (String) row.get("protocol");
|
||||
String identifier = (String) row.get("identifier");
|
||||
String uuid = (String) row.get("uuid");
|
||||
@@ -488,39 +496,39 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
results.add(pair);
|
||||
}
|
||||
};
|
||||
template.queryWithRowHandler(SELECT_NODES_BY_TYPE_AND_NAME_PATTERN, params, rowHandler);
|
||||
template.select(SELECT_NODES_BY_TYPE_AND_NAME_PATTERN, params, resultHandler);
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getOldAttrTenantsImpl(RowHandler rowHandler)
|
||||
protected void getOldAttrTenantsImpl(ResultHandler resultHandler)
|
||||
{
|
||||
template.queryWithRowHandler(SELECT_OLD_ATTR_TENANTS, rowHandler);
|
||||
template.select(SELECT_OLD_ATTR_TENANTS, resultHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getOldAttrAVMLocksImpl(RowHandler rowHandler)
|
||||
protected void getOldAttrAVMLocksImpl(ResultHandler resultHandler)
|
||||
{
|
||||
template.queryWithRowHandler(SELECT_OLD_ATTR_AVM_LOCKS, rowHandler);
|
||||
template.select(SELECT_OLD_ATTR_AVM_LOCKS, resultHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getOldAttrPropertyBackedBeansImpl(RowHandler rowHandler)
|
||||
protected void getOldAttrPropertyBackedBeansImpl(ResultHandler resultHandler)
|
||||
{
|
||||
template.queryWithRowHandler(SELECT_OLD_ATTR_PBBS, rowHandler);
|
||||
template.select(SELECT_OLD_ATTR_PBBS, resultHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getOldAttrChainingURSImpl(RowHandler rowHandler)
|
||||
protected void getOldAttrChainingURSImpl(ResultHandler resultHandler)
|
||||
{
|
||||
template.queryWithRowHandler(SELECT_OLD_ATTR_CHAINING_URS, rowHandler);
|
||||
template.select(SELECT_OLD_ATTR_CHAINING_URS, resultHandler);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<String> getOldAttrCustomNamesImpl()
|
||||
{
|
||||
return (List<String>)template.queryForList(SELECT_OLD_ATTR_CUSTOM_NAMES);
|
||||
return (List<String>)template.selectList(SELECT_OLD_ATTR_CUSTOM_NAMES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -545,7 +553,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
public List<Map<String, Object>> getAclsThatInheritFromNonPrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
||||
SELECT_ACLS_THAT_INHERIT_FROM_NON_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
@@ -555,7 +563,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
public List<Map<String, Object>> getAclsThatInheritWithInheritanceUnset()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
||||
SELECT_ACLS_THAT_INHERIT_WITH_INHERITANCE_UNSET,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
@@ -565,7 +573,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
public List<Map<String, Object>> getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
||||
SELECT_DEFINING_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
@@ -575,7 +583,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
@@ -585,7 +593,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
@Override
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.queryForList(
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
|
@@ -33,9 +33,8 @@ import org.alfresco.repo.domain.permissions.AuthorityAliasEntity;
|
||||
import org.alfresco.repo.domain.permissions.AuthorityEntity;
|
||||
import org.alfresco.repo.domain.permissions.PermissionEntity;
|
||||
import org.alfresco.repo.security.permissions.ACEType;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.engine.execution.SqlExecutor;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the ACL Crud DAO.
|
||||
@@ -45,7 +44,7 @@ import com.ibatis.sqlmap.engine.execution.SqlExecutor;
|
||||
*/
|
||||
public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
{
|
||||
private static final String INSERT_ACL = "alfresco.permissions.insert_Acl";
|
||||
private static final String INSERT_ACL = "alfresco.permissions.insert.insert_Acl";
|
||||
private static final String SELECT_ACL_BY_ID = "alfresco.permissions.select_AclById";
|
||||
private static final String SELECT_ACLS_THAT_INHERIT_FROM_ACL = "alfresco.permissions.select_AclsThatInheritFromAcl";
|
||||
private static final String SELECT_LATEST_ACL_BY_GUID = "alfresco.permissions.select_LatestAclByGuid";
|
||||
@@ -54,57 +53,57 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
private static final String UPDATE_ACL = "alfresco.permissions.update_Acl";
|
||||
private static final String DELETE_ACL = "alfresco.permissions.delete_Acl";
|
||||
|
||||
private static final String INSERT_ACL_MEMBER = "alfresco.permissions.insert_AclMember";
|
||||
private static final String INSERT_ACL_MEMBER = "alfresco.permissions.insert.insert_AclMember";
|
||||
private static final String SELECT_ACL_MEMBERS_BY_ACL = "alfresco.permissions.select_AclMembersByAclId";
|
||||
private static final String SELECT_ACL_MEMBERS_BY_AUTHORITY = "alfresco.permissions.select_AclMembersByAuthorityName";
|
||||
private static final String UPDATE_ACL_MEMBER = "alfresco.permissions.update_AclMember";
|
||||
private static final String DELETE_ACL_MEMBERS_LIST = "alfresco.permissions.delete_AclMembersList";
|
||||
private static final String DELETE_ACL_MEMBERS_BY_ACL = "alfresco.permissions.delete_AclMembersByAclId";
|
||||
|
||||
private static final String INSERT_ACL_CHANGESET = "alfresco.permissions.insert_AclChangeSet";
|
||||
private static final String INSERT_ACL_CHANGESET = "alfresco.permissions.insert.insert_AclChangeSet";
|
||||
private static final String SELECT_ACL_CHANGESET_BY_ID = "alfresco.permissions.select_AclChangeSetById";
|
||||
private static final String DELETE_ACL_CHANGESET = "alfresco.permissions.delete_AclChangeSet";
|
||||
|
||||
private static final String INSERT_ACE = "alfresco.permissions.insert_Ace";
|
||||
private static final String INSERT_ACE = "alfresco.permissions.insert.insert_Ace";
|
||||
private static final String SELECT_ACE_BY_ID = "alfresco.permissions.select_AceById";
|
||||
private static final String SELECT_ACES_BY_AUTHORITY = "alfresco.permissions.select_AcesByAuthorityId";
|
||||
private static final String SELECT_ACES_AND_AUTHORIES_BY_ACL = "alfresco.permissions.select_AcesAndAuthoritiesByAclId";
|
||||
private static final String SELECT_ACE_WITH_NO_CONTEXT = "alfresco.permissions.select_AceWithNoContext";
|
||||
private static final String DELETE_ACES_LIST = "alfresco.permissions.delete_AcesList";
|
||||
|
||||
private static final String INSERT_ACE_CONTEXT = "alfresco.permissions.insert_AceContext";
|
||||
private static final String INSERT_ACE_CONTEXT = "alfresco.permissions.insert.insert_AceContext";
|
||||
private static final String SELECT_ACE_CONTEXT_BY_ID = "alfresco.permissions.select_AceContextById";
|
||||
private static final String DELETE_ACE_CONTEXT = "alfresco.permissions.delete_AceContext";
|
||||
|
||||
private static final String INSERT_PERMISSION = "alfresco.permissions.insert_Permission";
|
||||
private static final String INSERT_PERMISSION = "alfresco.permissions.insert.insert_Permission";
|
||||
private static final String SELECT_PERMISSION_BY_ID = "alfresco.permissions.select_PermissionById";
|
||||
private static final String SELECT_PERMISSION_BY_TYPE_AND_NAME = "alfresco.permissions.select_PermissionByTypeAndName";
|
||||
private static final String UPDATE_PERMISSION = "alfresco.permissions.update_Permission";
|
||||
private static final String DELETE_PERMISSION = "alfresco.permissions.delete_Permission";
|
||||
|
||||
private static final String INSERT_AUTHORITY = "alfresco.permissions.insert_Authority";
|
||||
private static final String INSERT_AUTHORITY = "alfresco.permissions.insert.insert_Authority";
|
||||
private static final String SELECT_AUTHORITY_BY_ID = "alfresco.permissions.select_AuthorityById";
|
||||
private static final String SELECT_AUTHORITY_BY_NAME = "alfresco.permissions.select_AuthorityByName";
|
||||
private static final String UPDATE_AUTHORITY = "alfresco.permissions.update_Authority";
|
||||
private static final String DELETE_AUTHORITY = "alfresco.permissions.delete_Authority";
|
||||
|
||||
private static final String INSERT_AUTHORITY_ALIAS = "alfresco.permissions.insert_AuthorityAlias";
|
||||
private static final String INSERT_AUTHORITY_ALIAS = "alfresco.permissions.insert.insert_AuthorityAlias";
|
||||
private static final String DELETE_AUTHORITY_ALIAS = "alfresco.permissions.delete_AuthorityAlias";
|
||||
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected AclEntity createAclEntity(AclEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
Long id = (Long)template.insert(INSERT_ACL, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_ACL, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -114,7 +113,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclEntityId);
|
||||
|
||||
return (AclEntity)template.queryForObject(SELECT_ACL_BY_ID, params);
|
||||
return (AclEntity)template.selectOne(SELECT_ACL_BY_ID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -125,7 +124,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
params.put("id", aclEntityId);
|
||||
params.put("bool", true);
|
||||
|
||||
return (List<Long>)template.queryForList(SELECT_ACLS_THAT_INHERIT_FROM_ACL, params);
|
||||
return (List<Long>)template.selectList(SELECT_ACLS_THAT_INHERIT_FROM_ACL, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +134,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
params.put("name", aclGuid);
|
||||
params.put("bool", true);
|
||||
|
||||
return (Long)template.queryForObject(SELECT_LATEST_ACL_BY_GUID, params);
|
||||
return (Long)template.selectOne(SELECT_LATEST_ACL_BY_GUID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -144,13 +143,13 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
{
|
||||
if (maxResults < 0)
|
||||
{
|
||||
maxResults = SqlExecutor.NO_MAXIMUM_RESULTS;
|
||||
maxResults = RowBounds.NO_ROW_LIMIT;
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclEntityId);
|
||||
|
||||
return (List<Long>)template.queryForList(SELECT_ADM_NODES_BY_ACL, params, 0 , maxResults);
|
||||
return (List<Long>)template.selectList(SELECT_ADM_NODES_BY_ACL, params, new RowBounds(0 , maxResults));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -159,13 +158,13 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
{
|
||||
if (maxResults < 0)
|
||||
{
|
||||
maxResults = SqlExecutor.NO_MAXIMUM_RESULTS;
|
||||
maxResults = RowBounds.NO_ROW_LIMIT;
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclEntityId);
|
||||
|
||||
return (List<Long>)template.queryForList(SELECT_AVM_NODES_BY_ACL, params, 0 , maxResults);
|
||||
return (List<Long>)template.selectList(SELECT_AVM_NODES_BY_ACL, params, new RowBounds(0 , maxResults));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -189,8 +188,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected AclMemberEntity createAclMemberEntity(AclMemberEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
Long id = (Long)template.insert(INSERT_ACL_MEMBER, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_ACL_MEMBER, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -201,7 +199,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclEntityId);
|
||||
|
||||
return (List<AclMemberEntity>) template.queryForList(SELECT_ACL_MEMBERS_BY_ACL, params);
|
||||
return (List<AclMemberEntity>) template.selectList(SELECT_ACL_MEMBERS_BY_ACL, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -211,7 +209,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("name", authorityName);
|
||||
|
||||
return (List<AclMemberEntity>) template.queryForList(SELECT_ACL_MEMBERS_BY_AUTHORITY, params);
|
||||
return (List<AclMemberEntity>) template.selectList(SELECT_ACL_MEMBERS_BY_AUTHORITY, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,7 +240,9 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
{
|
||||
AclChangeSetEntity entity = new AclChangeSetEntity();
|
||||
entity.setVersion(0L);
|
||||
return (Long)template.insert(INSERT_ACL_CHANGESET, entity);
|
||||
template.insert(INSERT_ACL_CHANGESET, entity);
|
||||
Long id = entity.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -251,7 +251,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclChangeSetEntityId);
|
||||
|
||||
return (AclChangeSetEntity)template.queryForObject(SELECT_ACL_CHANGESET_BY_ID, params);
|
||||
return (AclChangeSetEntity)template.selectOne(SELECT_ACL_CHANGESET_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -267,7 +267,9 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected long createAceEntity(AceEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
return (Long)template.insert(INSERT_ACE, entity);
|
||||
template.insert(INSERT_ACE, entity);
|
||||
Long id = entity.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -276,7 +278,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aceEntityId);
|
||||
|
||||
return (AceEntity)template.queryForObject(SELECT_ACE_BY_ID, params);
|
||||
return (AceEntity)template.selectOne(SELECT_ACE_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -288,7 +290,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
params.put("bool", allowed);
|
||||
params.put("int", type.getId());
|
||||
|
||||
return (AceEntity)template.queryForObject(SELECT_ACE_WITH_NO_CONTEXT, params);
|
||||
return (AceEntity)template.selectOne(SELECT_ACE_WITH_NO_CONTEXT, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -298,7 +300,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", authorityEntityId);
|
||||
|
||||
return (List<Ace>) template.queryForList(SELECT_ACES_BY_AUTHORITY, params);
|
||||
return (List<Ace>) template.selectList(SELECT_ACES_BY_AUTHORITY, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -308,7 +310,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aclEntityId);
|
||||
|
||||
return (List<Map<String, Object>>) template.queryForList(SELECT_ACES_AND_AUTHORIES_BY_ACL, params);
|
||||
return (List<Map<String, Object>>) template.selectList(SELECT_ACES_AND_AUTHORIES_BY_ACL, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,7 +323,9 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected long createAceContextEntity(AceContextEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
return (Long)template.insert(INSERT_ACE_CONTEXT, entity);
|
||||
template.insert(INSERT_ACE_CONTEXT, entity);
|
||||
Long id = entity.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,7 +334,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", aceContextEntityId);
|
||||
|
||||
return (AceContextEntity)template.queryForObject(SELECT_ACE_CONTEXT_BY_ID, params);
|
||||
return (AceContextEntity)template.selectOne(SELECT_ACE_CONTEXT_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -346,8 +350,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected PermissionEntity createPermissionEntity(PermissionEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
Long id = (Long)template.insert(INSERT_PERMISSION, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_PERMISSION, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -357,7 +360,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", permissionEntityId);
|
||||
|
||||
return (PermissionEntity)template.queryForObject(SELECT_PERMISSION_BY_ID, params);
|
||||
return (PermissionEntity)template.selectOne(SELECT_PERMISSION_BY_ID, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -367,7 +370,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
params.put("id", qnameId);
|
||||
params.put("name", name);
|
||||
|
||||
return (PermissionEntity)template.queryForObject(SELECT_PERMISSION_BY_TYPE_AND_NAME, params);
|
||||
return (PermissionEntity)template.selectOne(SELECT_PERMISSION_BY_TYPE_AND_NAME, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -391,8 +394,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected AuthorityEntity createAuthorityEntity(AuthorityEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
Long id = (Long)template.insert(INSERT_AUTHORITY, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_AUTHORITY, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -402,7 +404,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", authorityEntityId);
|
||||
|
||||
return (AuthorityEntity)template.queryForObject(SELECT_AUTHORITY_BY_ID, params);
|
||||
return (AuthorityEntity)template.selectOne(SELECT_AUTHORITY_BY_ID, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -415,7 +417,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
|
||||
// note: allow for list (non-unique name) in case of upgrade of old schemas
|
||||
AuthorityEntity result = null;
|
||||
List<AuthorityEntity> authorities = (List<AuthorityEntity>)template.queryForList(SELECT_AUTHORITY_BY_NAME, params);
|
||||
List<AuthorityEntity> authorities = (List<AuthorityEntity>)template.selectList(SELECT_AUTHORITY_BY_NAME, params);
|
||||
for (AuthorityEntity found : authorities)
|
||||
{
|
||||
if (found.getAuthority().equals(authorityName))
|
||||
@@ -448,7 +450,9 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
||||
protected long createAuthorityAliasEntity(AuthorityAliasEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
return (Long)template.insert(INSERT_AUTHORITY_ALIAS, entity);
|
||||
template.insert(INSERT_AUTHORITY_ALIAS, entity);
|
||||
Long id = entity.getId();
|
||||
return (id != null ? id : -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,7 +22,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.ibatis.RollupRowHandler;
|
||||
import org.alfresco.ibatis.RollupResultHandler;
|
||||
import org.alfresco.repo.domain.propval.AbstractPropertyValueDAOImpl;
|
||||
import org.alfresco.repo.domain.propval.PropertyClassEntity;
|
||||
import org.alfresco.repo.domain.propval.PropertyDateValueEntity;
|
||||
@@ -39,9 +39,11 @@ import org.alfresco.repo.domain.propval.PropertyUniqueContextEntity;
|
||||
import org.alfresco.repo.domain.propval.PropertyValueEntity;
|
||||
import org.alfresco.repo.domain.propval.PropertyValueEntity.PersistedType;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the PropertyValue DAO.
|
||||
@@ -53,53 +55,55 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
private static final String SELECT_PROPERTY_CLASS_BY_ID = "alfresco.propval.select_PropertyClassByID";
|
||||
private static final String SELECT_PROPERTY_CLASS_BY_NAME = "alfresco.propval.select_PropertyClassByName";
|
||||
private static final String INSERT_PROPERTY_CLASS = "alfresco.propval.insert_PropertyClass";
|
||||
private static final String INSERT_PROPERTY_CLASS = "alfresco.propval.insert.insert_PropertyClass";
|
||||
|
||||
private static final String SELECT_PROPERTY_DATE_VALUE_BY_ID = "alfresco.propval.select_PropertyDateValueByID";
|
||||
private static final String SELECT_PROPERTY_DATE_VALUE_BY_VALUE = "alfresco.propval.select_PropertyDateValueByValue";
|
||||
private static final String INSERT_PROPERTY_DATE_VALUE = "alfresco.propval.insert_PropertyDateValue";
|
||||
private static final String INSERT_PROPERTY_DATE_VALUE = "alfresco.propval.insert.insert_PropertyDateValue";
|
||||
|
||||
private static final String SELECT_PROPERTY_STRING_VALUE_BY_ID = "alfresco.propval.select_PropertyStringValueByID";
|
||||
private static final String SELECT_PROPERTY_STRING_VALUE_BY_VALUE = "alfresco.propval.select_PropertyStringValueByValue";
|
||||
private static final String INSERT_PROPERTY_STRING_VALUE = "alfresco.propval.insert_PropertyStringValue";
|
||||
private static final String INSERT_PROPERTY_STRING_VALUE = "alfresco.propval.insert.insert_PropertyStringValue";
|
||||
|
||||
private static final String SELECT_PROPERTY_DOUBLE_VALUE_BY_ID = "alfresco.propval.select_PropertyDoubleValueByID";
|
||||
private static final String SELECT_PROPERTY_DOUBLE_VALUE_BY_VALUE = "alfresco.propval.select_PropertyDoubleValueByValue";
|
||||
private static final String INSERT_PROPERTY_DOUBLE_VALUE = "alfresco.propval.insert_PropertyDoubleValue";
|
||||
private static final String INSERT_PROPERTY_DOUBLE_VALUE = "alfresco.propval.insert.insert_PropertyDoubleValue";
|
||||
|
||||
private static final String SELECT_PROPERTY_SERIALIZABLE_VALUE_BY_ID = "alfresco.propval.select_PropertySerializableValueByID";
|
||||
private static final String INSERT_PROPERTY_SERIALIZABLE_VALUE = "alfresco.propval.insert_PropertySerializableValue";
|
||||
private static final String INSERT_PROPERTY_SERIALIZABLE_VALUE = "alfresco.propval.insert.insert_PropertySerializableValue";
|
||||
|
||||
private static final String SELECT_PROPERTY_VALUE_BY_ID = "alfresco.propval.select_PropertyValueById";
|
||||
private static final String SELECT_PROPERTY_VALUE_BY_LOCAL_VALUE = "alfresco.propval.select_PropertyValueByLocalValue";
|
||||
private static final String SELECT_PROPERTY_VALUE_BY_DOUBLE_VALUE = "alfresco.propval.select_PropertyValueByDoubleValue";
|
||||
private static final String SELECT_PROPERTY_VALUE_BY_STRING_VALUE = "alfresco.propval.select_PropertyValueByStringValue";
|
||||
private static final String INSERT_PROPERTY_VALUE = "alfresco.propval.insert_PropertyValue";
|
||||
private static final String INSERT_PROPERTY_VALUE = "alfresco.propval.insert.insert_PropertyValue";
|
||||
|
||||
private static final String SELECT_PROPERTY_BY_ID = "alfresco.propval.select_PropertyById";
|
||||
private static final String SELECT_PROPERTIES_BY_IDS = "alfresco.propval.select_PropertiesByIds";
|
||||
private static final String SELECT_PROPERTY_ROOT_BY_ID = "alfresco.propval.select_PropertyRootById";
|
||||
private static final String INSERT_PROPERTY_ROOT = "alfresco.propval.insert_PropertyRoot";
|
||||
private static final String INSERT_PROPERTY_ROOT = "alfresco.propval.insert.insert_PropertyRoot";
|
||||
private static final String UPDATE_PROPERTY_ROOT = "alfresco.propval.update_PropertyRoot";
|
||||
private static final String DELETE_PROPERTY_ROOT_BY_ID = "alfresco.propval.delete_PropertyRootById";
|
||||
|
||||
private static final String SELECT_PROPERTY_UNIQUE_CTX_BY_ID = "alfresco.propval.select_PropertyUniqueContextById";
|
||||
private static final String SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES = "alfresco.propval.select_PropertyUniqueContextByValues";
|
||||
private static final String INSERT_PROPERTY_UNIQUE_CTX = "alfresco.propval.insert_PropertyUniqueContext";
|
||||
private static final String INSERT_PROPERTY_UNIQUE_CTX = "alfresco.propval.insert.insert_PropertyUniqueContext";
|
||||
private static final String UPDATE_PROPERTY_UNIQUE_CTX = "alfresco.propval.update_PropertyUniqueContext";
|
||||
private static final String DELETE_PROPERTY_UNIQUE_CTX_BY_ID = "alfresco.propval.delete_PropertyUniqueContextById";
|
||||
private static final String DELETE_PROPERTY_UNIQUE_CTX_BY_VALUES = "alfresco.propval.delete_PropertyUniqueContextByValues";
|
||||
|
||||
private static final String INSERT_PROPERTY_LINK = "alfresco.propval.insert_PropertyLink";
|
||||
private static final String INSERT_PROPERTY_LINK = "alfresco.propval.insert.insert_PropertyLink";
|
||||
private static final String DELETE_PROPERTY_LINKS_BY_ROOT_ID = "alfresco.propval.delete_PropertyLinksByRootId";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
//================================
|
||||
// 'alf_prop_class' accessors
|
||||
//================================
|
||||
@@ -109,7 +113,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyClassEntity entity = new PropertyClassEntity();
|
||||
entity.setId(id);
|
||||
entity = (PropertyClassEntity) template.queryForObject(
|
||||
entity = (PropertyClassEntity) template.selectOne(
|
||||
SELECT_PROPERTY_CLASS_BY_ID,
|
||||
entity);
|
||||
// Done
|
||||
@@ -121,7 +125,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyClassEntity entity = new PropertyClassEntity();
|
||||
entity.setJavaClass(value);
|
||||
entity = (PropertyClassEntity) template.queryForObject(
|
||||
entity = (PropertyClassEntity) template.selectOne(
|
||||
SELECT_PROPERTY_CLASS_BY_NAME,
|
||||
entity);
|
||||
// Done
|
||||
@@ -133,8 +137,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyClassEntity entity = new PropertyClassEntity();
|
||||
entity.setJavaClass(value);
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_CLASS, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_PROPERTY_CLASS, entity);
|
||||
// Done
|
||||
return entity;
|
||||
}
|
||||
@@ -146,7 +149,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
@Override
|
||||
protected PropertyDateValueEntity findDateValueById(Long id)
|
||||
{
|
||||
PropertyDateValueEntity entity = (PropertyDateValueEntity) template.queryForObject(
|
||||
PropertyDateValueEntity entity = (PropertyDateValueEntity) template.selectOne(
|
||||
SELECT_PROPERTY_DATE_VALUE_BY_ID,
|
||||
id);
|
||||
// Done
|
||||
@@ -156,7 +159,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
@Override
|
||||
protected PropertyDateValueEntity findDateValueByValue(Date value)
|
||||
{
|
||||
PropertyDateValueEntity result = (PropertyDateValueEntity) template.queryForObject(
|
||||
PropertyDateValueEntity result = (PropertyDateValueEntity) template.selectOne(
|
||||
SELECT_PROPERTY_DATE_VALUE_BY_VALUE,
|
||||
new Long(value.getTime()));
|
||||
// The ID is the actual time in ms (GMT)
|
||||
@@ -182,7 +185,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
||||
entity.setId(id);
|
||||
String value = (String) template.queryForObject(
|
||||
String value = (String) template.selectOne(
|
||||
SELECT_PROPERTY_STRING_VALUE_BY_ID,
|
||||
entity);
|
||||
// Done
|
||||
@@ -195,10 +198,10 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
||||
entity.setValue(value);
|
||||
List<Long> rows = (List<Long>) template.queryForList(
|
||||
List<Long> rows = (List<Long>) template.selectList(
|
||||
SELECT_PROPERTY_STRING_VALUE_BY_VALUE,
|
||||
entity,
|
||||
0, 1);
|
||||
new RowBounds(0, 1));
|
||||
// The CRC match prevents incorrect results from coming back. Although there could be
|
||||
// several matches, we are sure that the matches are case-sensitive.
|
||||
if (rows.size() > 0)
|
||||
@@ -216,9 +219,9 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
||||
entity.setValue(value);
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_STRING_VALUE, entity);
|
||||
template.insert(INSERT_PROPERTY_STRING_VALUE, entity);
|
||||
// Done
|
||||
return id;
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
//================================
|
||||
@@ -230,7 +233,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
||||
entity.setId(id);
|
||||
entity = (PropertyDoubleValueEntity) template.queryForObject(
|
||||
entity = (PropertyDoubleValueEntity) template.selectOne(
|
||||
SELECT_PROPERTY_DOUBLE_VALUE_BY_ID,
|
||||
entity);
|
||||
// Done
|
||||
@@ -243,10 +246,10 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
||||
entity.setDoubleValue(value);
|
||||
List<PropertyDoubleValueEntity> results = (List<PropertyDoubleValueEntity>) template.queryForList(
|
||||
List<PropertyDoubleValueEntity> results = (List<PropertyDoubleValueEntity>) template.selectList(
|
||||
SELECT_PROPERTY_DOUBLE_VALUE_BY_VALUE,
|
||||
entity,
|
||||
0, 1);
|
||||
new RowBounds(0, 1));
|
||||
// There could be several matches, so just get one
|
||||
if (results.size() > 0)
|
||||
{
|
||||
@@ -264,8 +267,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
||||
entity.setDoubleValue(value);
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_DOUBLE_VALUE, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_PROPERTY_DOUBLE_VALUE, entity);
|
||||
// Done
|
||||
return entity;
|
||||
}
|
||||
@@ -279,7 +281,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertySerializableValueEntity entity = new PropertySerializableValueEntity();
|
||||
entity.setId(id);
|
||||
entity = (PropertySerializableValueEntity) template.queryForObject(
|
||||
entity = (PropertySerializableValueEntity) template.selectOne(
|
||||
SELECT_PROPERTY_SERIALIZABLE_VALUE_BY_ID,
|
||||
entity);
|
||||
// Done
|
||||
@@ -291,8 +293,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertySerializableValueEntity entity = new PropertySerializableValueEntity();
|
||||
entity.setSerializableValue(value);
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_SERIALIZABLE_VALUE, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_PROPERTY_SERIALIZABLE_VALUE, entity);
|
||||
// Done
|
||||
return entity;
|
||||
}
|
||||
@@ -307,7 +308,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyValueEntity entity = new PropertyValueEntity();
|
||||
entity.setId(id);
|
||||
List<PropertyValueEntity> results = (List<PropertyValueEntity>) template.queryForList(
|
||||
List<PropertyValueEntity> results = (List<PropertyValueEntity>) template.selectList(
|
||||
SELECT_PROPERTY_VALUE_BY_ID,
|
||||
entity);
|
||||
// At most one of the results represents a real value
|
||||
@@ -388,7 +389,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
if (query != null)
|
||||
{
|
||||
// Uniqueness is guaranteed by the tables, so we get one value only
|
||||
result = (PropertyValueEntity) template.queryForObject(query, queryObject);
|
||||
result = (PropertyValueEntity) template.selectOne(query, queryObject);
|
||||
}
|
||||
|
||||
// Done
|
||||
@@ -436,8 +437,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
}
|
||||
|
||||
// Persist the entity
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_VALUE, insertEntity);
|
||||
insertEntity.setId(id);
|
||||
template.insert(INSERT_PROPERTY_VALUE, insertEntity);
|
||||
// Done
|
||||
return insertEntity;
|
||||
}
|
||||
@@ -452,7 +452,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyValueEntity entity = new PropertyValueEntity();
|
||||
entity.setId(id);
|
||||
List<PropertyIdSearchRow> results = (List<PropertyIdSearchRow>) template.queryForList(
|
||||
List<PropertyIdSearchRow> results = (List<PropertyIdSearchRow>) template.selectList(
|
||||
SELECT_PROPERTY_BY_ID,
|
||||
entity);
|
||||
return results;
|
||||
@@ -462,11 +462,11 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
@Override
|
||||
protected void findPropertiesByIds(List<Long> ids, final PropertyFinderCallback callback)
|
||||
{
|
||||
RowHandler valueRowHandler = new RowHandler()
|
||||
ResultHandler valueResultHandler = new ResultHandler()
|
||||
{
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
PropertyIdQueryResult result = (PropertyIdQueryResult) valueObject;
|
||||
PropertyIdQueryResult result = (PropertyIdQueryResult) context.getResultObject();
|
||||
Long id = result.getPropId();
|
||||
// Make the serializable value
|
||||
List<PropertyIdSearchRow> rows = result.getPropValues();
|
||||
@@ -475,16 +475,16 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
}
|
||||
};
|
||||
// A row handler to roll up individual rows
|
||||
RollupRowHandler rollupRowHandler = new RollupRowHandler(
|
||||
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
||||
KEY_COLUMNS_FINDBYIDS,
|
||||
"propValues",
|
||||
valueRowHandler);
|
||||
valueResultHandler);
|
||||
// Query using the IDs
|
||||
PropertyIdQueryParameter params = new PropertyIdQueryParameter();
|
||||
params.setRootPropIds(ids);
|
||||
template.queryWithRowHandler(SELECT_PROPERTIES_BY_IDS, params, rollupRowHandler);
|
||||
template.select(SELECT_PROPERTIES_BY_IDS, params, rollupResultHandler);
|
||||
// Process any remaining results
|
||||
rollupRowHandler.processLastResults();
|
||||
rollupResultHandler.processLastResults();
|
||||
// Done
|
||||
}
|
||||
|
||||
@@ -493,7 +493,8 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyRootEntity rootEntity = new PropertyRootEntity();
|
||||
rootEntity.setVersion((short)0);
|
||||
return (Long) template.insert(INSERT_PROPERTY_ROOT, rootEntity);
|
||||
template.insert(INSERT_PROPERTY_ROOT, rootEntity);
|
||||
return rootEntity.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -501,14 +502,19 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyRootEntity entity = new PropertyRootEntity();
|
||||
entity.setId(id);
|
||||
return (PropertyRootEntity) template.queryForObject(SELECT_PROPERTY_ROOT_BY_ID, entity);
|
||||
return (PropertyRootEntity) template.selectOne(SELECT_PROPERTY_ROOT_BY_ID, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity)
|
||||
{
|
||||
entity.incrementVersion();
|
||||
template.update(UPDATE_PROPERTY_ROOT, entity, 1);
|
||||
int updated = template.update(UPDATE_PROPERTY_ROOT, entity);
|
||||
if (updated != 1)
|
||||
{
|
||||
// unexpected number of rows affected
|
||||
throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyRoot: " + entity + ": expected 1, actual " + updated);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -530,8 +536,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
entity.setValue2PropId(valueId2);
|
||||
entity.setValue3PropId(valueId3);
|
||||
entity.setPropertyId(propertyId);
|
||||
Long id = (Long) template.insert(INSERT_PROPERTY_UNIQUE_CTX, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_PROPERTY_UNIQUE_CTX, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -540,7 +545,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
{
|
||||
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
|
||||
entity.setId(id);
|
||||
entity = (PropertyUniqueContextEntity) template.queryForObject(SELECT_PROPERTY_UNIQUE_CTX_BY_ID, entity);
|
||||
entity = (PropertyUniqueContextEntity) template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_ID, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -551,7 +556,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
entity.setValue1PropId(valueId1);
|
||||
entity.setValue2PropId(valueId2);
|
||||
entity.setValue3PropId(valueId3);
|
||||
entity = (PropertyUniqueContextEntity) template.queryForObject(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity);
|
||||
entity = (PropertyUniqueContextEntity) template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -577,11 +582,11 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
}
|
||||
}
|
||||
|
||||
RowHandler valueRowHandler = new RowHandler()
|
||||
ResultHandler valueResultHandler = new ResultHandler()
|
||||
{
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
PropertyUniqueContextEntity result = (PropertyUniqueContextEntity) valueObject;
|
||||
PropertyUniqueContextEntity result = (PropertyUniqueContextEntity) context.getResultObject();
|
||||
|
||||
Long id = result.getId();
|
||||
Long propId = result.getPropertyId();
|
||||
@@ -594,7 +599,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
}
|
||||
};
|
||||
|
||||
template.queryWithRowHandler(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity, valueRowHandler);
|
||||
template.select(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity, valueResultHandler);
|
||||
// Done
|
||||
}
|
||||
|
||||
@@ -602,7 +607,12 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
||||
protected PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity)
|
||||
{
|
||||
entity.incrementVersion();
|
||||
template.update(UPDATE_PROPERTY_UNIQUE_CTX, entity, 1);
|
||||
int updated = template.update(UPDATE_PROPERTY_UNIQUE_CTX, entity);
|
||||
if (updated != 1)
|
||||
{
|
||||
// unexpected number of rows affected
|
||||
throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyUniqueContext: " + entity + ": expected 1, actual " + updated);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ package org.alfresco.repo.domain.qname.ibatis;
|
||||
import org.alfresco.repo.domain.qname.AbstractQNameDAOImpl;
|
||||
import org.alfresco.repo.domain.qname.NamespaceEntity;
|
||||
import org.alfresco.repo.domain.qname.QNameEntity;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific extension of the QName and Namespace abstract DAO
|
||||
@@ -33,18 +33,19 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
||||
{
|
||||
private static final String SELECT_NS_BY_ID = "alfresco.qname.select_NamespaceById";
|
||||
private static final String SELECT_NS_BY_URI = "alfresco.qname.select_NamespaceByUri";
|
||||
private static final String INSERT_NS = "alfresco.qname.insert_Namespace";
|
||||
private static final String INSERT_NS = "alfresco.qname.insert.insert_Namespace";
|
||||
private static final String UPDATE_NS = "alfresco.qname.update_Namespace";
|
||||
private static final String SELECT_QNAME_BY_ID = "alfresco.qname.select_QNameById";
|
||||
private static final String SELECT_QNAME_BY_NS_AND_LOCALNAME = "alfresco.qname.select_QNameByNsAndLocalName";
|
||||
private static final String INSERT_QNAME = "alfresco.qname.insert_QName";
|
||||
private static final String INSERT_QNAME = "alfresco.qname.insert.insert_QName";
|
||||
private static final String UPDATE_QNAME = "alfresco.qname.update_QName";
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +53,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
||||
{
|
||||
NamespaceEntity entity = new NamespaceEntity();
|
||||
entity.setId(id);
|
||||
entity = (NamespaceEntity) template.queryForObject(SELECT_NS_BY_ID, entity);
|
||||
entity = (NamespaceEntity) template.selectOne(SELECT_NS_BY_ID, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
||||
{
|
||||
NamespaceEntity entity = new NamespaceEntity();
|
||||
entity.setUriSafe(uri);
|
||||
entity = (NamespaceEntity) template.queryForObject(SELECT_NS_BY_URI, entity);
|
||||
entity = (NamespaceEntity) template.selectOne(SELECT_NS_BY_URI, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
||||
{
|
||||
QNameEntity entity = new QNameEntity();
|
||||
entity.setId(id);
|
||||
entity = (QNameEntity) template.queryForObject(SELECT_QNAME_BY_ID, entity);
|
||||
entity = (QNameEntity) template.selectOne(SELECT_QNAME_BY_ID, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -98,7 +99,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
||||
QNameEntity entity = new QNameEntity();
|
||||
entity.setNamespaceId(nsId);
|
||||
entity.setLocalNameSafe(localName);
|
||||
entity = (QNameEntity) template.queryForObject(SELECT_QNAME_BY_NS_AND_LOCALNAME, entity);
|
||||
entity = (QNameEntity) template.selectOne(SELECT_QNAME_BY_NS_AND_LOCALNAME, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
@@ -18,12 +18,10 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.query.ibatis;
|
||||
|
||||
import java.sql.Savepoint;
|
||||
|
||||
import org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl;
|
||||
import org.alfresco.repo.domain.query.QueryException;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* DAO implementation providing canned query support.
|
||||
@@ -33,11 +31,11 @@ import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
*/
|
||||
public class CannedQueryDAOImpl extends AbstractCannedQueryDAOImpl
|
||||
{
|
||||
private SqlMapClientTemplate template;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +58,7 @@ public class CannedQueryDAOImpl extends AbstractCannedQueryDAOImpl
|
||||
|
||||
try
|
||||
{
|
||||
Long result = (Long) template.queryForObject(query, parameterObj);
|
||||
Long result = (Long) template.selectOne(query, parameterObj);
|
||||
if (result == null)
|
||||
{
|
||||
result = 0L;
|
||||
|
@@ -42,7 +42,7 @@ import java.util.Properties;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.ibatis.SerializableTypeHandlerCallback;
|
||||
import org.alfresco.ibatis.SerializableTypeHandler;
|
||||
import org.alfresco.repo.admin.patch.Patch;
|
||||
import org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch;
|
||||
import org.alfresco.repo.content.filestore.FileContentWriter;
|
||||
@@ -1266,7 +1266,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
}
|
||||
|
||||
int maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
|
||||
int serializableType = SerializableTypeHandlerCallback.getSerializableType();
|
||||
int serializableType = SerializableTypeHandler.getSerializableType();
|
||||
// Adjust the maximum allowable String length according to the dialect
|
||||
if (dialect instanceof AlfrescoSQLServerDialect)
|
||||
{
|
||||
@@ -1312,7 +1312,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
|
||||
}
|
||||
SchemaBootstrap.setMaxStringLength(maxStringLength);
|
||||
SerializableTypeHandlerCallback.setSerializableType(serializableType);
|
||||
SerializableTypeHandler.setSerializableType(serializableType);
|
||||
|
||||
// Now override the maximum string length if it was set directly
|
||||
if (maximumStringLength > 0)
|
||||
|
@@ -11,7 +11,8 @@ import org.alfresco.repo.domain.solr.NodeParameters;
|
||||
import org.alfresco.repo.domain.solr.SOLRDAO;
|
||||
import org.alfresco.repo.domain.solr.SOLRTransactionParameters;
|
||||
import org.alfresco.repo.domain.solr.Transaction;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* DAO support for SOLR web scripts.
|
||||
@@ -24,17 +25,15 @@ public class SOLRDAOImpl implements SOLRDAO
|
||||
private static final String SELECT_NODES = "alfresco.solr.select_Txn_Nodes";
|
||||
|
||||
private QNameDAO qnameDAO;
|
||||
private SqlMapClientTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
public SqlMapClientTemplate getSqlMapClientTemplate()
|
||||
{
|
||||
return this.template;
|
||||
}
|
||||
|
||||
public void setQNameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
@@ -63,11 +62,11 @@ public class SOLRDAOImpl implements SOLRDAO
|
||||
|
||||
if(maxResults != 0 && maxResults != Integer.MAX_VALUE)
|
||||
{
|
||||
txns = (List<Transaction>)template.queryForList(SELECT_TRANSACTIONS, params, 0, maxResults);
|
||||
txns = (List<Transaction>)template.selectList(SELECT_TRANSACTIONS, params, new RowBounds(0, maxResults));
|
||||
}
|
||||
else
|
||||
{
|
||||
txns = (List<Transaction>)template.queryForList(SELECT_TRANSACTIONS, params);
|
||||
txns = (List<Transaction>)template.selectList(SELECT_TRANSACTIONS, params);
|
||||
}
|
||||
|
||||
return txns;
|
||||
@@ -106,11 +105,11 @@ public class SOLRDAOImpl implements SOLRDAO
|
||||
|
||||
if(maxResults != 0 && maxResults != Integer.MAX_VALUE)
|
||||
{
|
||||
nodes = (List<NodeEntity>)template.queryForList(SELECT_NODES, nodeParameters, 0, maxResults);
|
||||
nodes = (List<NodeEntity>)template.selectList(SELECT_NODES, nodeParameters, new RowBounds(0, maxResults));
|
||||
}
|
||||
else
|
||||
{
|
||||
nodes = (List<NodeEntity>)template.queryForList(SELECT_NODES, nodeParameters);
|
||||
nodes = (List<NodeEntity>)template.selectList(SELECT_NODES, nodeParameters);
|
||||
}
|
||||
|
||||
for(NodeEntity node : nodes)
|
||||
|
@@ -30,9 +30,9 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.orm.ibatis.SqlMapClientTemplate;
|
||||
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
import org.apache.ibatis.session.ResultContext;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* iBatis-specific implementation of the Usage DAO.
|
||||
@@ -44,7 +44,7 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(UsageDAOImpl.class);
|
||||
|
||||
private static final String INSERT_USAGE_DELTA = "alfresco.usage.insert_UsageDelta";
|
||||
private static final String INSERT_USAGE_DELTA = "alfresco.usage.insert.insert_UsageDelta";
|
||||
private static final String SELECT_USAGE_DELTA_TOTAL_SIZE_BY_NODE = "alfresco.usage.select_GetTotalDeltaSizeByNodeId";
|
||||
private static final String SELECT_USAGE_DELTA_NODES = "alfresco.usage.select_GetUsageDeltaNodes";
|
||||
private static final String SELECT_USERS_WITH_USAGE = "alfresco.usage.select_GetUsersWithUsage";
|
||||
@@ -53,14 +53,16 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
private static final String DELETE_USAGE_DELTAS_BY_NODE = "alfresco.usage.delete_UsageDeltasByNodeId";
|
||||
|
||||
|
||||
private SqlMapClientTemplate template;
|
||||
private QNameDAO qnameDAO;
|
||||
private SqlSessionTemplate template;
|
||||
|
||||
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
this.template = sqlMapClientTemplate;
|
||||
this.template = sqlSessionTemplate;
|
||||
}
|
||||
|
||||
|
||||
private QNameDAO qnameDAO;
|
||||
|
||||
public void setQnameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
this.qnameDAO = qnameDAO;
|
||||
@@ -70,8 +72,7 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
protected UsageDeltaEntity insertUsageDeltaEntity(UsageDeltaEntity entity)
|
||||
{
|
||||
entity.setVersion(0L);
|
||||
Long id = (Long)template.insert(INSERT_USAGE_DELTA, entity);
|
||||
entity.setId(id);
|
||||
template.insert(INSERT_USAGE_DELTA, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -81,14 +82,14 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||
params.put("id", nodeEntityId);
|
||||
|
||||
return (UsageDeltaEntity) template.queryForObject(SELECT_USAGE_DELTA_TOTAL_SIZE_BY_NODE, params);
|
||||
return (UsageDeltaEntity) template.selectOne(SELECT_USAGE_DELTA_TOTAL_SIZE_BY_NODE, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected List<Long> selectUsageDeltaNodes()
|
||||
{
|
||||
return (List<Long>) template.queryForList(SELECT_USAGE_DELTA_NODES);
|
||||
return (List<Long>) template.selectList(SELECT_USAGE_DELTA_NODES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,13 +124,13 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
params.put("storeProtocol", storeRef.getProtocol());
|
||||
params.put("storeIdentifier", storeRef.getIdentifier());
|
||||
|
||||
MapRowHandler rowHandler = new MapRowHandler(resultsCallback);
|
||||
MapResultHandler resultHandler = new MapResultHandler(resultsCallback);
|
||||
|
||||
template.queryWithRowHandler(SELECT_USERS_WITHOUT_USAGE, params, rowHandler);
|
||||
template.select(SELECT_USERS_WITHOUT_USAGE, params, resultHandler);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" Listed " + rowHandler.total + " users without usage");
|
||||
logger.debug(" Listed " + resultHandler.total + " users without usage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,13 +157,13 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
params.put("storeProtocol", storeRef.getProtocol());
|
||||
params.put("storeIdentifier", storeRef.getIdentifier());
|
||||
|
||||
MapRowHandler rowHandler = new MapRowHandler(resultsCallback);
|
||||
MapResultHandler resultHandler = new MapResultHandler(resultsCallback);
|
||||
|
||||
template.queryWithRowHandler(SELECT_USERS_WITH_USAGE, params, rowHandler);
|
||||
template.select(SELECT_USERS_WITH_USAGE, params, resultHandler);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" Listed " + rowHandler.total + " users with usage");
|
||||
logger.debug(" Listed " + resultHandler.total + " users with usage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
Long ownerPropQNameEntityId = ownerPropQNamePair.getFirst();
|
||||
Long contentPropQNameEntityId = contentPropQNamePair.getFirst();
|
||||
|
||||
MapRowHandler rowHandler = new MapRowHandler(resultsCallback);
|
||||
MapResultHandler resultHandler = new MapResultHandler(resultsCallback);
|
||||
|
||||
Map<String, Object> params = new HashMap<String, Object>(5);
|
||||
params.put("contentTypeQNameID", contentTypeQNameEntityId); // cm:content (type)
|
||||
@@ -192,32 +193,32 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
||||
params.put("storeIdentifier", storeRef.getIdentifier());
|
||||
|
||||
// Query for the 'new' (FK) style content data properties (stored in 'string_value')
|
||||
template.queryWithRowHandler(SELECT_CONTENT_SIZES_NEW, params, rowHandler);
|
||||
template.select(SELECT_CONTENT_SIZES_NEW, params, resultHandler);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" Listed " + rowHandler.total + " old content sizes");
|
||||
logger.debug(" Listed " + resultHandler.total + " old content sizes");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Row handler for getting map of strings
|
||||
*/
|
||||
private static class MapRowHandler implements RowHandler
|
||||
private static class MapResultHandler implements ResultHandler
|
||||
{
|
||||
private final MapHandler handler;
|
||||
|
||||
private int total = 0;
|
||||
|
||||
private MapRowHandler(MapHandler handler)
|
||||
private MapResultHandler(MapHandler handler)
|
||||
{
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject)
|
||||
public void handleResult(ResultContext context)
|
||||
{
|
||||
handler.handle((Map<String, Object>)valueObject);
|
||||
handler.handle((Map<String, Object>)context.getResultObject());
|
||||
total++;
|
||||
if (logger.isDebugEnabled() && (total == 0 || (total % 1000 == 0) ))
|
||||
{
|
||||
|
@@ -55,8 +55,6 @@ import org.springframework.dao.DeadlockLoserDataAccessException;
|
||||
import org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException;
|
||||
import org.springframework.jdbc.UncategorizedSQLException;
|
||||
|
||||
import com.ibatis.common.jdbc.exception.NestedSQLException;
|
||||
|
||||
/**
|
||||
* A helper that runs a unit of work inside a UserTransaction,
|
||||
* transparently retrying the unit of work if the cause of
|
||||
@@ -99,7 +97,6 @@ public class RetryingTransactionHelper
|
||||
ConstraintViolationException.class,
|
||||
UncategorizedSQLException.class,
|
||||
SQLException.class,
|
||||
NestedSQLException.class,
|
||||
BatchUpdateException.class,
|
||||
DataIntegrityViolationException.class,
|
||||
StaleStateException.class,
|
||||
@@ -560,7 +557,7 @@ public class RetryingTransactionHelper
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (retryCause instanceof NestedSQLException || retryCause instanceof UncategorizedSQLException)
|
||||
else if (retryCause instanceof UncategorizedSQLException)
|
||||
{
|
||||
// The exception will have been caused by something else, so check that instead
|
||||
if (retryCause.getCause() != null && retryCause.getCause() != retryCause)
|
||||
|
Reference in New Issue
Block a user