mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
78519: Merged EOL (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 78398: ACE-81 Upgrade MyBatis to 3.2.7 - myBatis 3.2.7 upgrade onto Spring 3.2 upgrade. Merged in appropriate sections from BRANCHES/DEV/DEREK/ALF-19099 and fixed - myBatis namespace config issue. Full maven build with unit tests works, repo and share start and the basics seem to be working. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82583 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -13,6 +13,9 @@ Inbound settings from iBatis
|
|||||||
maxSessions="500"
|
maxSessions="500"
|
||||||
/>
|
/>
|
||||||
-->
|
-->
|
||||||
|
<settings>
|
||||||
|
<setting name="safeResultHandlerEnabled" value="false"/>
|
||||||
|
</settings>
|
||||||
|
|
||||||
<typeAliases>
|
<typeAliases>
|
||||||
|
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
<!-- MyBatis config for Alfresco (using common datasource) -->
|
<!-- MyBatis config for Alfresco (using common datasource) -->
|
||||||
<bean id="repoSqlSessionFactory" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean">
|
<bean id="repoSqlSessionFactory" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean">
|
||||||
<property name="useLocalCaches" value="${mybatis.useLocalCaches}"/>
|
|
||||||
<property name="resourceLoader" ref="dialectResourceLoader"/>
|
<property name="resourceLoader" ref="dialectResourceLoader"/>
|
||||||
<property name="dataSource" ref="dataSource"/>
|
<property name="dataSource" ref="dataSource"/>
|
||||||
<property name="configLocation">
|
<property name="configLocation">
|
||||||
|
@@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
<mapper namespace="alfresco.node.select.children">
|
<mapper namespace="alfresco.node.select.children">
|
||||||
|
|
||||||
<select id="select_ChildAssocsOfParent_Limited" parameterType="ChildAssoc" resultMap="result_ChildAssoc">
|
<select id="select_ChildAssocsOfParent_Limited" parameterType="ChildAssoc" resultMap="alfresco.node.result_ChildAssoc">
|
||||||
<include refid="alfresco.node.select_ChildAssocsOfParent_Query"/>
|
<include refid="alfresco.node.select_ChildAssocsOfParent_Query"/>
|
||||||
<if test="ordered == true">
|
<if test="ordered == true">
|
||||||
<include refid="alfresco.node.select_ChildAssoc_OrderBy"/>
|
<include refid="alfresco.node.select_ChildAssoc_OrderBy"/>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="select_ChildNodeIds_Limited" parameterType="ChildAssoc" resultMap="result_ChildAssocIds">
|
<select id="select_ChildNodeIds_Limited" parameterType="ChildAssoc" resultMap="alfresco.node.result_ChildAssocIds">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
select
|
select
|
||||||
ca.id as id,
|
ca.id as id,
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<!-- Note the MySQL specific fetch size limitation (Integer.MIN_VALUE). fetchSize activates resultset streaming. -->
|
<!-- Note the MySQL specific fetch size limitation (Integer.MIN_VALUE). fetchSize activates resultset streaming. -->
|
||||||
<!-- '1=1': Makes the SQL string unique WRT the prepared statement cache -->
|
<!-- '1=1': Makes the SQL string unique WRT the prepared statement cache -->
|
||||||
|
|
||||||
<select id="select_ChildAssocsOfParent_Limited" parameterType="ChildAssoc" resultMap="result_ChildAssoc" fetchSize="-2147483648">
|
<select id="select_ChildAssocsOfParent_Limited" parameterType="ChildAssoc" resultMap="alfresco.node.result_ChildAssoc" fetchSize="-2147483648">
|
||||||
<include refid="alfresco.node.select_ChildAssocsOfParent_Query"/>
|
<include refid="alfresco.node.select_ChildAssocsOfParent_Query"/>
|
||||||
and 1=1
|
and 1=1
|
||||||
<if test="ordered == true">
|
<if test="ordered == true">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="select_ChildNodeIds_Limited" parameterType="Ids" resultMap="result_ChildAssocIds" fetchSize="-2147483648">
|
<select id="select_ChildNodeIds_Limited" parameterType="Ids" resultMap="alfresco.node.result_ChildAssocIds" fetchSize="-2147483648">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
select
|
select
|
||||||
ca.id as id,
|
ca.id as id,
|
||||||
|
@@ -4,35 +4,35 @@
|
|||||||
|
|
||||||
<mapper namespace="alfresco.permissions.insert">
|
<mapper namespace="alfresco.permissions.insert">
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_Acl" parameterType="Acl" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_Acl" parameterType="Acl" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_Acl_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_Acl_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_AclMember" parameterType="AclMember" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_AclMember" parameterType="AclMember" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_AclMember_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_AclMember_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_AclChangeSet" parameterType="AclChangeSet" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_AclChangeSet" parameterType="AclChangeSet" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_AclChangeSet_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_AclChangeSet_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_Ace" parameterType="Ace" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_Ace" parameterType="Ace" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_Ace_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_Ace_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_AceContext" parameterType="AceContext" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_AceContext" parameterType="AceContext" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_AceContext_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_AceContext_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_Permission" parameterType="Permission" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_Permission" parameterType="Permission" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_Permission_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_Permission_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_Authority" parameterType="Authority" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_Authority" parameterType="Authority" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_Authority_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_Authority_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="alfresco.permissions.insert_AuthorityAlias" parameterType="AuthorityAlias" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert_AuthorityAlias" parameterType="AuthorityAlias" useGeneratedKeys="true" keyProperty="id">
|
||||||
<include refid="alfresco.permissions.insert_AuthorityAlias_AutoIncrement"/>
|
<include refid="alfresco.permissions.insert_AuthorityAlias_AutoIncrement"/>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
public int deleteFeedEntries(Integer maxIdRange) throws SQLException
|
public int deleteFeedEntries(Integer maxIdRange) throws SQLException
|
||||||
{
|
{
|
||||||
// Get the largest ID
|
// Get the largest ID
|
||||||
Long maxId = (Long) template.selectOne("alfresco.activities.select_activity_feed_entries_max_id");
|
Long maxId = template.selectOne("alfresco.activities.select_activity_feed_entries_max_id");
|
||||||
if (maxId == null)
|
if (maxId == null)
|
||||||
{
|
{
|
||||||
return 0; // This happens when there are no entries
|
return 0; // This happens when there are no entries
|
||||||
@@ -127,7 +127,7 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
@Override
|
@Override
|
||||||
public List<ActivityFeedEntity> selectUserFeedsToClean(int maxFeedSize) throws SQLException
|
public List<ActivityFeedEntity> selectUserFeedsToClean(int maxFeedSize) throws SQLException
|
||||||
{
|
{
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_user_feeds_greater_than_max", maxFeedSize);
|
return template.selectList("alfresco.activities.select_activity_user_feeds_greater_than_max", maxFeedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -150,17 +150,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if ((!excludeThisUser) && (!excludeOtherUsers))
|
if ((!excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_and_site", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_and_site", params);
|
||||||
}
|
}
|
||||||
else if ((excludeThisUser) && (!excludeOtherUsers))
|
else if ((excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_others_and_site", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_others_and_site", params);
|
||||||
}
|
}
|
||||||
else if ((excludeOtherUsers) && (!excludeThisUser))
|
else if ((excludeOtherUsers) && (!excludeThisUser))
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_me_and_site", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_me_and_site", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -175,17 +175,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if (!excludeThisUser && !excludeOtherUsers)
|
if (!excludeThisUser && !excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser", params);
|
||||||
}
|
}
|
||||||
else if (excludeThisUser)
|
else if (excludeThisUser)
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_others", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_others", params);
|
||||||
}
|
}
|
||||||
else if (excludeOtherUsers)
|
else if (excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_me", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_feeduser_me", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
@Override
|
@Override
|
||||||
public List<ActivityFeedEntity> selectSiteFeedsToClean(int maxFeedSize) throws SQLException
|
public List<ActivityFeedEntity> selectSiteFeedsToClean(int maxFeedSize) throws SQLException
|
||||||
{
|
{
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select_activity_site_feeds_greater_than_max", maxFeedSize);
|
return template.selectList("alfresco.activities.select_activity_site_feeds_greater_than_max", maxFeedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -228,17 +228,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if ((!excludeThisUser) && (!excludeOtherUsers))
|
if ((!excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select.select_activity_feed_for_feeduser_and_site", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_and_site", params, rowBounds);
|
||||||
}
|
}
|
||||||
else if ((excludeThisUser) && (!excludeOtherUsers))
|
else if ((excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_others_and_site", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_others_and_site", params, rowBounds);
|
||||||
}
|
}
|
||||||
else if ((excludeOtherUsers) && (!excludeThisUser))
|
else if ((excludeOtherUsers) && (!excludeThisUser))
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_me_and_site", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_me_and_site", params, rowBounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -253,17 +253,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if (!excludeThisUser && !excludeOtherUsers)
|
if (!excludeThisUser && !excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser", params, rowBounds);
|
||||||
}
|
}
|
||||||
else if (excludeThisUser)
|
else if (excludeThisUser)
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_others", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_others", params, rowBounds);
|
||||||
}
|
}
|
||||||
else if (excludeOtherUsers)
|
else if (excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_me", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_feeduser_me", params, rowBounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
{
|
{
|
||||||
RowBounds rowBounds = new RowBounds(skipCount, maxItems);
|
RowBounds rowBounds = new RowBounds(skipCount, maxItems);
|
||||||
|
|
||||||
feedEntries = (List<ActivityFeedEntity>)template.selectList(sql, params, rowBounds);
|
feedEntries = template.selectList(sql, params, rowBounds);
|
||||||
Iterator<ActivityFeedEntity> feedEntriesIt = feedEntries.iterator();
|
Iterator<ActivityFeedEntity> feedEntriesIt = feedEntries.iterator();
|
||||||
|
|
||||||
while(feedEntriesIt.hasNext() && numAddedItems < expectedMaxItems)
|
while(feedEntriesIt.hasNext() && numAddedItems < expectedMaxItems)
|
||||||
@@ -401,17 +401,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if ((!excludeThisUser) && (!excludeOtherUsers))
|
if ((!excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser_and_site", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser_and_site", params, pagingRequest));
|
||||||
}
|
}
|
||||||
else if ((excludeThisUser) && (!excludeOtherUsers))
|
else if ((excludeThisUser) && (!excludeOtherUsers))
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser_others_and_site", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser_others_and_site", params, pagingRequest));
|
||||||
}
|
}
|
||||||
else if ((excludeOtherUsers) && (!excludeThisUser))
|
else if ((excludeOtherUsers) && (!excludeThisUser))
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser_me_and_site", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser_me_and_site", params, pagingRequest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -426,17 +426,17 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
if (!excludeThisUser && !excludeOtherUsers)
|
if (!excludeThisUser && !excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// no excludes => everyone => where feed user is me
|
// no excludes => everyone => where feed user is me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser", params, pagingRequest));
|
||||||
}
|
}
|
||||||
else if (excludeThisUser)
|
else if (excludeThisUser)
|
||||||
{
|
{
|
||||||
// exclude feed user => others => where feed user is me and post user is not me
|
// exclude feed user => others => where feed user is me and post user is not me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser_others", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser_others", params, pagingRequest));
|
||||||
}
|
}
|
||||||
else if (excludeOtherUsers)
|
else if (excludeOtherUsers)
|
||||||
{
|
{
|
||||||
// exclude others => me => where feed user is me and post user is me
|
// exclude others => me => where feed user is me and post user is me
|
||||||
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select_activity_feed_for_feeduser_me", params, pagingRequest));
|
return getPagingResults(pagingRequest, filterByNetwork(networkId, siteId, "alfresco.activities.select.select_activity_feed_for_feeduser_me", params, pagingRequest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
params.setSiteNetwork(siteId);
|
params.setSiteNetwork(siteId);
|
||||||
|
|
||||||
// for given site
|
// for given site
|
||||||
return (Long)template.selectOne("alfresco.activities.count_activity_feed_for_site", params);
|
return template.selectOne("alfresco.activities.count_activity_feed_for_site", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -465,6 +465,6 @@ public class ActivityFeedDAOImpl extends ActivitiesDAOImpl implements ActivityFe
|
|||||||
RowBounds rowBounds = new RowBounds(RowBounds.NO_ROW_OFFSET, rowLimit);
|
RowBounds rowBounds = new RowBounds(RowBounds.NO_ROW_OFFSET, rowLimit);
|
||||||
|
|
||||||
// for given site
|
// for given site
|
||||||
return (List<ActivityFeedEntity>)template.selectList("alfresco.activities.select.select_activity_feed_for_site", params, rowBounds);
|
return template.selectList("alfresco.activities.select.select_activity_feed_for_site", params, rowBounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -44,11 +44,11 @@ public class ActivityPostDAOImpl extends ActivitiesDAOImpl implements ActivityPo
|
|||||||
(activityPost.getMaxId() != -1) &&
|
(activityPost.getMaxId() != -1) &&
|
||||||
(activityPost.getStatus() != null))
|
(activityPost.getStatus() != null))
|
||||||
{
|
{
|
||||||
return (List<ActivityPostEntity>)template.selectList("alfresco.activities.select_activity_posts_by_params", activityPost, rowBounds);
|
return template.selectList("alfresco.activities.select_activity_posts_by_params", activityPost, rowBounds);
|
||||||
}
|
}
|
||||||
else if (activityPost.getStatus() != null)
|
else if (activityPost.getStatus() != null)
|
||||||
{
|
{
|
||||||
return (List<ActivityPostEntity>)template.selectList("alfresco.activities.select_activity_posts_by_status", activityPost, rowBounds);
|
return template.selectList("alfresco.activities.select_activity_posts_by_status", activityPost, rowBounds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -58,17 +58,17 @@ public class ActivityPostDAOImpl extends ActivitiesDAOImpl implements ActivityPo
|
|||||||
|
|
||||||
public Long getMaxActivitySeq() throws SQLException
|
public Long getMaxActivitySeq() throws SQLException
|
||||||
{
|
{
|
||||||
return (Long)template.selectOne("alfresco.activities.select_activity_post_max_seq");
|
return template.selectOne("alfresco.activities.select_activity_post_max_seq");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getMinActivitySeq() throws SQLException
|
public Long getMinActivitySeq() throws SQLException
|
||||||
{
|
{
|
||||||
return (Long)template.selectOne("alfresco.activities.select_activity_post_min_seq");
|
return template.selectOne("alfresco.activities.select_activity_post_min_seq");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getMaxNodeHash() throws SQLException
|
public Integer getMaxNodeHash() throws SQLException
|
||||||
{
|
{
|
||||||
return (Integer)template.selectOne("alfresco.activities.select_activity_post_max_jobtasknode");
|
return template.selectOne("alfresco.activities.select_activity_post_max_jobtasknode");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int updatePost(long id, String siteNetwork, String activityData, ActivityPostEntity.STATUS status) throws SQLException
|
public int updatePost(long id, String siteNetwork, String activityData, ActivityPostEntity.STATUS status) throws SQLException
|
||||||
|
@@ -43,12 +43,12 @@ public class FeedControlDAOImpl extends ActivitiesDAOImpl implements FeedControl
|
|||||||
{
|
{
|
||||||
FeedControlEntity params = new FeedControlEntity(feedUserId);
|
FeedControlEntity params = new FeedControlEntity(feedUserId);
|
||||||
|
|
||||||
return (List<FeedControlEntity>)template.selectList("alfresco.activities.select_activity_feedcontrols_for_user", params);
|
return template.selectList("alfresco.activities.select_activity_feedcontrols_for_user", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long selectFeedControl(FeedControlEntity activityFeedControl) throws SQLException
|
public long selectFeedControl(FeedControlEntity activityFeedControl) throws SQLException
|
||||||
{
|
{
|
||||||
Long id = (Long)template.selectOne("alfresco.activities.select_activity_feedcontrol", activityFeedControl);
|
Long id = template.selectOne("alfresco.activities.select_activity_feedcontrol", activityFeedControl);
|
||||||
return (id != null ? id : -1);
|
return (id != null ? id : -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ import org.alfresco.repo.domain.audit.AuditQueryParameters;
|
|||||||
import org.alfresco.repo.domain.audit.AuditQueryResult;
|
import org.alfresco.repo.domain.audit.AuditQueryResult;
|
||||||
import org.alfresco.repo.domain.propval.PropertyValueDAO.PropertyFinderCallback;
|
import org.alfresco.repo.domain.propval.PropertyValueDAO.PropertyFinderCallback;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
|
import org.apache.ibatis.session.Configuration;
|
||||||
import org.apache.ibatis.session.ResultContext;
|
import org.apache.ibatis.session.ResultContext;
|
||||||
import org.apache.ibatis.session.ResultHandler;
|
import org.apache.ibatis.session.ResultHandler;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
@@ -77,7 +78,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
{
|
{
|
||||||
AuditModelEntity entity = new AuditModelEntity();
|
AuditModelEntity entity = new AuditModelEntity();
|
||||||
entity.setContentCrc(crc);
|
entity.setContentCrc(crc);
|
||||||
entity = (AuditModelEntity) template.selectOne(
|
entity = template.selectOne(
|
||||||
SELECT_MODEL_BY_CRC,
|
SELECT_MODEL_BY_CRC,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -99,7 +100,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
{
|
{
|
||||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||||
params.put("id", id);
|
params.put("id", id);
|
||||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.selectOne(
|
AuditApplicationEntity entity = template.selectOne(
|
||||||
SELECT_APPLICATION_BY_ID,
|
SELECT_APPLICATION_BY_ID,
|
||||||
params);
|
params);
|
||||||
// Done
|
// Done
|
||||||
@@ -123,7 +124,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||||
params.put("id", appNamePair.getFirst());
|
params.put("id", appNamePair.getFirst());
|
||||||
AuditApplicationEntity entity = (AuditApplicationEntity) template.selectOne(
|
AuditApplicationEntity entity = template.selectOne(
|
||||||
SELECT_APPLICATION_BY_NAME_ID,
|
SELECT_APPLICATION_BY_NAME_ID,
|
||||||
params);
|
params);
|
||||||
// Done
|
// Done
|
||||||
@@ -281,7 +282,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
List<AuditQueryResult> rows = (List<AuditQueryResult>) template.selectList(SELECT_ENTRIES_WITHOUT_VALUES, params, new RowBounds(0, maxResults));
|
List<AuditQueryResult> rows = template.selectList(SELECT_ENTRIES_WITHOUT_VALUES, params, new RowBounds(0, maxResults));
|
||||||
for (AuditQueryResult row : rows)
|
for (AuditQueryResult row : rows)
|
||||||
{
|
{
|
||||||
resultsByValueId.put(row.getAuditValuesId(), row);
|
resultsByValueId.put(row.getAuditValuesId(), row);
|
||||||
@@ -317,7 +318,9 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
rowHandler.processResult((AuditQueryResult)context.getResultObject());
|
rowHandler.processResult((AuditQueryResult)context.getResultObject());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Configuration configuration = template.getConfiguration();
|
||||||
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
||||||
|
configuration,
|
||||||
new String[] {"auditEntryId"},
|
new String[] {"auditEntryId"},
|
||||||
"auditValueRows",
|
"auditValueRows",
|
||||||
queryResultHandler,
|
queryResultHandler,
|
||||||
|
@@ -103,7 +103,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
{
|
{
|
||||||
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
||||||
contentUrlEntity.setId(id);
|
contentUrlEntity.setId(id);
|
||||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_ID, contentUrlEntity);
|
contentUrlEntity = template.selectOne(SELECT_CONTENT_URL_BY_ID, contentUrlEntity);
|
||||||
// Done
|
// Done
|
||||||
return contentUrlEntity;
|
return contentUrlEntity;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
{
|
{
|
||||||
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
||||||
}
|
}
|
||||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_KEY, contentUrlEntity);
|
contentUrlEntity = template.selectOne(SELECT_CONTENT_URL_BY_KEY, contentUrlEntity);
|
||||||
// Done
|
// Done
|
||||||
return contentUrlEntity;
|
return contentUrlEntity;
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
|
|
||||||
ContentUrlOrphanQuery query = new ContentUrlOrphanQuery();
|
ContentUrlOrphanQuery query = new ContentUrlOrphanQuery();
|
||||||
query.setMaxOrphanTimeExclusive(maxOrphanTimeExclusive);
|
query.setMaxOrphanTimeExclusive(maxOrphanTimeExclusive);
|
||||||
List<ContentUrlEntity> results = (List<ContentUrlEntity>) template.selectList(SELECT_CONTENT_URLS_ORPHANED,
|
List<ContentUrlEntity> results = template.selectList(SELECT_CONTENT_URLS_ORPHANED,
|
||||||
query,
|
query,
|
||||||
new RowBounds(0, maxResults));
|
new RowBounds(0, maxResults));
|
||||||
// Pass the result to the callback
|
// Pass the result to the callback
|
||||||
@@ -171,7 +171,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
{
|
{
|
||||||
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
contentUrlEntity.setContentUrlShort(contentUrlEntity.getContentUrlShort().toLowerCase());
|
||||||
}
|
}
|
||||||
contentUrlEntity = (ContentUrlEntity) template.selectOne(SELECT_CONTENT_URL_BY_KEY_UNREFERENCED, contentUrlEntity);
|
contentUrlEntity = template.selectOne(SELECT_CONTENT_URL_BY_KEY_UNREFERENCED, contentUrlEntity);
|
||||||
// Done
|
// Done
|
||||||
return contentUrlEntity;
|
return contentUrlEntity;
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
{
|
{
|
||||||
Map<String, Object> params = new HashMap<String, Object>(11);
|
Map<String, Object> params = new HashMap<String, Object>(11);
|
||||||
params.put("id", id);
|
params.put("id", id);
|
||||||
ContentDataEntity contentDataEntity = (ContentDataEntity) template.selectOne(SELECT_CONTENT_DATA_BY_ID, params);
|
ContentDataEntity contentDataEntity = template.selectOne(SELECT_CONTENT_DATA_BY_ID, params);
|
||||||
// Done
|
// Done
|
||||||
return contentDataEntity;
|
return contentDataEntity;
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
}
|
}
|
||||||
IdsEntity idsEntity = new IdsEntity();
|
IdsEntity idsEntity = new IdsEntity();
|
||||||
idsEntity.setIds(new ArrayList<Long>(nodeIds));
|
idsEntity.setIds(new ArrayList<Long>(nodeIds));
|
||||||
return (List<ContentDataEntity>)template.selectList(SELECT_CONTENT_DATA_BY_NODE_IDS, idsEntity);
|
return template.selectList(SELECT_CONTENT_DATA_BY_NODE_IDS, idsEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -267,7 +267,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
|
|||||||
idsEntity.setIdOne(nodeId);
|
idsEntity.setIdOne(nodeId);
|
||||||
idsEntity.setIds(new ArrayList<Long>(qnameIds));
|
idsEntity.setIds(new ArrayList<Long>(qnameIds));
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Long> ids = (List<Long>) template.selectList(SELECT_CONTENT_DATA_BY_NODE_AND_QNAME, idsEntity);
|
List<Long> ids = template.selectList(SELECT_CONTENT_DATA_BY_NODE_AND_QNAME, idsEntity);
|
||||||
// Delete each one
|
// Delete each one
|
||||||
for (Long id : ids)
|
for (Long id : ids)
|
||||||
{
|
{
|
||||||
|
@@ -49,7 +49,7 @@ public class EncodingDAOImpl extends AbstractEncodingDAOImpl
|
|||||||
{
|
{
|
||||||
EncodingEntity encodingEntity = new EncodingEntity();
|
EncodingEntity encodingEntity = new EncodingEntity();
|
||||||
encodingEntity.setId(id);
|
encodingEntity.setId(id);
|
||||||
encodingEntity = (EncodingEntity) template.selectOne(SELECT_ENCODING_BY_ID, encodingEntity);
|
encodingEntity = template.selectOne(SELECT_ENCODING_BY_ID, encodingEntity);
|
||||||
// Done
|
// Done
|
||||||
return encodingEntity;
|
return encodingEntity;
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ public class EncodingDAOImpl extends AbstractEncodingDAOImpl
|
|||||||
{
|
{
|
||||||
EncodingEntity encodingEntity = new EncodingEntity();
|
EncodingEntity encodingEntity = new EncodingEntity();
|
||||||
encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
|
encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
|
||||||
encodingEntity = (EncodingEntity) template.selectOne(SELECT_ENCODING_BY_KEY, encodingEntity);
|
encodingEntity = template.selectOne(SELECT_ENCODING_BY_KEY, encodingEntity);
|
||||||
// Could be null
|
// Could be null
|
||||||
return encodingEntity;
|
return encodingEntity;
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ public class LocaleDAOImpl extends AbstractLocaleDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", id);
|
params.put("id", id);
|
||||||
|
|
||||||
return (LocaleEntity) template.selectOne(SELECT_LOCALE_BY_ID, params);
|
return template.selectOne(SELECT_LOCALE_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,7 +61,7 @@ public class LocaleDAOImpl extends AbstractLocaleDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("str", localeStr);
|
params.put("str", localeStr);
|
||||||
|
|
||||||
return (LocaleEntity) template.selectOne(SELECT_LOCALE_BY_NAME, params);
|
return template.selectOne(SELECT_LOCALE_BY_NAME, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -60,7 +60,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
|||||||
LockResourceEntity lockResource = new LockResourceEntity();
|
LockResourceEntity lockResource = new LockResourceEntity();
|
||||||
lockResource.setQnameNamespaceId(qnameNamespaceId);
|
lockResource.setQnameNamespaceId(qnameNamespaceId);
|
||||||
lockResource.setQnameLocalName(qnameLocalName == null ? null : qnameLocalName.toLowerCase());
|
lockResource.setQnameLocalName(qnameLocalName == null ? null : qnameLocalName.toLowerCase());
|
||||||
lockResource = (LockResourceEntity) template.selectOne(SELECT_LOCKRESOURCE_BY_QNAME, lockResource);
|
lockResource = template.selectOne(SELECT_LOCKRESOURCE_BY_QNAME, lockResource);
|
||||||
// Could be null
|
// Could be null
|
||||||
return lockResource;
|
return lockResource;
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected List<LockEntity> getLocksBySharedResourceIds(List<Long> sharedLockResourceIds)
|
protected List<LockEntity> getLocksBySharedResourceIds(List<Long> sharedLockResourceIds)
|
||||||
{
|
{
|
||||||
List<LockEntity> locks = (List<LockEntity>) template.selectList(SELECT_LOCK_BY_SHARED_IDS, sharedLockResourceIds);
|
List<LockEntity> locks = template.selectList(SELECT_LOCK_BY_SHARED_IDS, sharedLockResourceIds);
|
||||||
// Done
|
// Done
|
||||||
return locks;
|
return locks;
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
|||||||
{
|
{
|
||||||
LockEntity lock = new LockEntity();
|
LockEntity lock = new LockEntity();
|
||||||
lock.setId(id);
|
lock.setId(id);
|
||||||
lock = (LockEntity) template.selectOne(SELECT_LOCK_BY_ID, lock);
|
lock = template.selectOne(SELECT_LOCK_BY_ID, lock);
|
||||||
// Done
|
// Done
|
||||||
return lock;
|
return lock;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public class LockDAOImpl extends AbstractLockDAOImpl
|
|||||||
LockEntity lock = new LockEntity();
|
LockEntity lock = new LockEntity();
|
||||||
lock.setSharedResourceId(sharedResourceId);
|
lock.setSharedResourceId(sharedResourceId);
|
||||||
lock.setExclusiveResourceId(exclusiveResourceId);
|
lock.setExclusiveResourceId(exclusiveResourceId);
|
||||||
lock = (LockEntity) template.selectOne(SELECT_LOCK_BY_KEY, lock);
|
lock = template.selectOne(SELECT_LOCK_BY_KEY, lock);
|
||||||
// Done
|
// Done
|
||||||
return lock;
|
return lock;
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ public class MimetypeDAOImpl extends AbstractMimetypeDAOImpl
|
|||||||
{
|
{
|
||||||
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
||||||
mimetypeEntity.setId(id);
|
mimetypeEntity.setId(id);
|
||||||
mimetypeEntity = (MimetypeEntity) template.selectOne(SELECT_MIMETYPE_BY_ID, mimetypeEntity);
|
mimetypeEntity = template.selectOne(SELECT_MIMETYPE_BY_ID, mimetypeEntity);
|
||||||
// Done
|
// Done
|
||||||
return mimetypeEntity;
|
return mimetypeEntity;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ public class MimetypeDAOImpl extends AbstractMimetypeDAOImpl
|
|||||||
{
|
{
|
||||||
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
MimetypeEntity mimetypeEntity = new MimetypeEntity();
|
||||||
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
|
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
|
||||||
mimetypeEntity = (MimetypeEntity) template.selectOne(SELECT_MIMETYPE_BY_KEY, mimetypeEntity);
|
mimetypeEntity = template.selectOne(SELECT_MIMETYPE_BY_KEY, mimetypeEntity);
|
||||||
// Could be null
|
// Could be null
|
||||||
return mimetypeEntity;
|
return mimetypeEntity;
|
||||||
}
|
}
|
||||||
|
@@ -98,9 +98,9 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
private static final String SELECT_NODE_PROPERTIES = "alfresco.node.select_NodeProperties";
|
private static final String SELECT_NODE_PROPERTIES = "alfresco.node.select_NodeProperties";
|
||||||
private static final String SELECT_PROPERTIES_BY_TYPES = "alfresco.node.select_PropertiesByTypes";
|
private static final String SELECT_PROPERTIES_BY_TYPES = "alfresco.node.select_PropertiesByTypes";
|
||||||
private static final String SELECT_NODE_ASPECTS = "alfresco.node.select_NodeAspects";
|
private static final String SELECT_NODE_ASPECTS = "alfresco.node.select_NodeAspects";
|
||||||
private static final String INSERT_NODE_PROPERTY = "alfresco.node.insert.insert_NodeProperty";
|
private static final String INSERT_NODE_PROPERTY = "alfresco.node.insert_NodeProperty";
|
||||||
private static final String UPDATE_PRIMARY_CHILDREN_SHARED_ACL = "alfresco.node.update.update_PrimaryChildrenSharedAcl";
|
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 INSERT_NODE_ASPECT = "alfresco.node.insert_NodeAspect";
|
||||||
private static final String DELETE_NODE_ASPECTS = "alfresco.node.delete_NodeAspects";
|
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 DELETE_NODE_PROPERTIES = "alfresco.node.delete_NodeProperties";
|
||||||
private static final String SELECT_NODES_WITH_ASPECT_IDS = "alfresco.node.select_NodesWithAspectIds";
|
private static final String SELECT_NODES_WITH_ASPECT_IDS = "alfresco.node.select_NodesWithAspectIds";
|
||||||
@@ -212,7 +212,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
ServerEntity entity = new ServerEntity();
|
ServerEntity entity = new ServerEntity();
|
||||||
entity.setIpAddress(ipAddress);
|
entity.setIpAddress(ipAddress);
|
||||||
// Potentially more results if there is a case issue (unlikely)
|
// Potentially more results if there is a case issue (unlikely)
|
||||||
List<ServerEntity> results = (List<ServerEntity>) template.selectList(SELECT_SERVER_BY_IPADDRESS, entity);
|
List<ServerEntity> results = template.selectList(SELECT_SERVER_BY_IPADDRESS, entity);
|
||||||
for (ServerEntity serverEntity : results)
|
for (ServerEntity serverEntity : results)
|
||||||
{
|
{
|
||||||
// Take the first one that matches regardless of case
|
// Take the first one that matches regardless of case
|
||||||
@@ -270,7 +270,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected List<StoreEntity> selectAllStores()
|
protected List<StoreEntity> selectAllStores()
|
||||||
{
|
{
|
||||||
return (List<StoreEntity>) template.selectList(SELECT_STORE_ALL);
|
return template.selectList(SELECT_STORE_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -279,7 +279,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
StoreEntity store = new StoreEntity();
|
StoreEntity store = new StoreEntity();
|
||||||
store.setProtocol(storeRef.getProtocol());
|
store.setProtocol(storeRef.getProtocol());
|
||||||
store.setIdentifier(storeRef.getIdentifier());
|
store.setIdentifier(storeRef.getIdentifier());
|
||||||
return (StoreEntity) template.selectOne(SELECT_STORE_BY_REF, store);
|
return template.selectOne(SELECT_STORE_BY_REF, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -288,7 +288,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
StoreEntity store = new StoreEntity();
|
StoreEntity store = new StoreEntity();
|
||||||
store.setProtocol(storeRef.getProtocol());
|
store.setProtocol(storeRef.getProtocol());
|
||||||
store.setIdentifier(storeRef.getIdentifier());
|
store.setIdentifier(storeRef.getIdentifier());
|
||||||
return (NodeEntity) template.selectOne(SELECT_STORE_ROOT_NODE_BY_REF, store);
|
return template.selectOne(SELECT_STORE_ROOT_NODE_BY_REF, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -399,7 +399,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
NodeEntity node = new NodeEntity();
|
NodeEntity node = new NodeEntity();
|
||||||
node.setId(id);
|
node.setId(id);
|
||||||
|
|
||||||
return (NodeEntity) template.selectOne(SELECT_NODE_BY_ID, node);
|
return template.selectOne(SELECT_NODE_BY_ID, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -421,7 +421,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
}
|
}
|
||||||
node.setUuid(uuid);
|
node.setUuid(uuid);
|
||||||
|
|
||||||
return (NodeEntity) template.selectOne(SELECT_NODE_BY_NODEREF, node);
|
return template.selectOne(SELECT_NODE_BY_NODEREF, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -434,7 +434,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// UUID
|
// UUID
|
||||||
nodeBatchLoadEntity.setUuids(new ArrayList<String>(uuids));
|
nodeBatchLoadEntity.setUuids(new ArrayList<String>(uuids));
|
||||||
|
|
||||||
return (List<Node>) template.selectList(SELECT_NODES_BY_UUIDS, nodeBatchLoadEntity);
|
return template.selectList(SELECT_NODES_BY_UUIDS, nodeBatchLoadEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -445,7 +445,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// IDs
|
// IDs
|
||||||
nodeBatchLoadEntity.setIds(new ArrayList<Long>(ids));
|
nodeBatchLoadEntity.setIds(new ArrayList<Long>(ids));
|
||||||
|
|
||||||
return (List<Node>) template.selectList(SELECT_NODES_BY_IDS, nodeBatchLoadEntity);
|
return template.selectList(SELECT_NODES_BY_IDS, nodeBatchLoadEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
NodePropertyEntity prop = new NodePropertyEntity();
|
NodePropertyEntity prop = new NodePropertyEntity();
|
||||||
prop.setNodeIds(new ArrayList<Long>(nodeIds));
|
prop.setNodeIds(new ArrayList<Long>(nodeIds));
|
||||||
|
|
||||||
List<NodePropertyEntity> rows = (List<NodePropertyEntity>) template.selectList(SELECT_NODE_PROPERTIES, prop);
|
List<NodePropertyEntity> rows = template.selectList(SELECT_NODE_PROPERTIES, prop);
|
||||||
return makePersistentPropertiesMap(rows);
|
return makePersistentPropertiesMap(rows);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@@ -534,7 +534,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
prop.setQnameIds(new ArrayList<Long>(qnameIds));
|
prop.setQnameIds(new ArrayList<Long>(qnameIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<NodePropertyEntity> rows = (List<NodePropertyEntity>) template.selectList(SELECT_NODE_PROPERTIES, prop);
|
List<NodePropertyEntity> rows = template.selectList(SELECT_NODE_PROPERTIES, prop);
|
||||||
return makePersistentPropertiesMap(rows);
|
return makePersistentPropertiesMap(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,7 +624,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
NodeAspectsEntity aspects = new NodeAspectsEntity();
|
NodeAspectsEntity aspects = new NodeAspectsEntity();
|
||||||
aspects.setNodeIds(new ArrayList<Long>(nodeIds));
|
aspects.setNodeIds(new ArrayList<Long>(nodeIds));
|
||||||
|
|
||||||
List<NodeAspectsEntity> rows = (List<NodeAspectsEntity>) template.selectList(SELECT_NODE_ASPECTS, aspects);
|
List<NodeAspectsEntity> rows = template.selectList(SELECT_NODE_ASPECTS, aspects);
|
||||||
|
|
||||||
Map<NodeVersionKey, Set<QName>> results = new HashMap<NodeVersionKey, Set<QName>>(rows.size()*2);
|
Map<NodeVersionKey, Set<QName>> results = new HashMap<NodeVersionKey, Set<QName>>(rows.size()*2);
|
||||||
for (NodeAspectsEntity nodeAspectsEntity : rows)
|
for (NodeAspectsEntity nodeAspectsEntity : rows)
|
||||||
@@ -751,7 +751,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
NodeEntity node = new NodeEntity();
|
NodeEntity node = new NodeEntity();
|
||||||
node.setId(nodeId);
|
node.setId(nodeId);
|
||||||
|
|
||||||
return (List<NodeAssocEntity>) template.selectList(SELECT_NODE_ASSOCS, node);
|
return template.selectList(SELECT_NODE_ASSOCS, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -766,7 +766,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Type
|
// Type
|
||||||
assoc.setTypeQNameId(typeQNameId);
|
assoc.setTypeQNameId(typeQNameId);
|
||||||
|
|
||||||
return (List<NodeAssocEntity>) template.selectList(SELECT_NODE_ASSOCS_BY_SOURCE, assoc);
|
return template.selectList(SELECT_NODE_ASSOCS_BY_SOURCE, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -781,7 +781,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Type
|
// Type
|
||||||
assoc.setTypeQNameId(typeQNameId);
|
assoc.setTypeQNameId(typeQNameId);
|
||||||
|
|
||||||
return (List<NodeAssocEntity>) template.selectList(SELECT_NODE_ASSOCS_BY_TARGET, assoc);
|
return template.selectList(SELECT_NODE_ASSOCS_BY_TARGET, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -790,7 +790,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
NodeAssocEntity assoc = new NodeAssocEntity();
|
NodeAssocEntity assoc = new NodeAssocEntity();
|
||||||
assoc.setId(assocId);
|
assoc.setId(assocId);
|
||||||
|
|
||||||
return (NodeAssocEntity) template.selectOne(SELECT_NODE_ASSOC_BY_ID, assoc);
|
return template.selectOne(SELECT_NODE_ASSOC_BY_ID, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -804,7 +804,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Assoc
|
// Assoc
|
||||||
assoc.setTypeQNameId(assocTypeQNameId);
|
assoc.setTypeQNameId(assocTypeQNameId);
|
||||||
|
|
||||||
Integer maxIndex = (Integer) template.selectOne(SELECT_NODE_ASSOCS_MAX_INDEX, assoc);
|
Integer maxIndex = template.selectOne(SELECT_NODE_ASSOCS_MAX_INDEX, assoc);
|
||||||
return maxIndex == null ? 0 : maxIndex.intValue();
|
return maxIndex == null ? 0 : maxIndex.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
ChildAssocEntity assoc = new ChildAssocEntity();
|
ChildAssocEntity assoc = new ChildAssocEntity();
|
||||||
assoc.setId(assocId);
|
assoc.setId(assocId);
|
||||||
|
|
||||||
return (ChildAssocEntity) template.selectOne(SELECT_CHILD_ASSOC_BY_ID, assoc);
|
return template.selectOne(SELECT_CHILD_ASSOC_BY_ID, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -888,7 +888,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
assoc.setId(minAssocIdInclusive);
|
assoc.setId(minAssocIdInclusive);
|
||||||
|
|
||||||
RowBounds rowBounds = new RowBounds(0, maxResults);
|
RowBounds rowBounds = new RowBounds(0, maxResults);
|
||||||
return (List<ChildAssocEntity>) template.selectList(SELECT_CHILD_NODE_IDS, assoc, rowBounds);
|
return template.selectList(SELECT_CHILD_NODE_IDS, assoc, rowBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -903,7 +903,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Primary
|
// Primary
|
||||||
assoc.setPrimary(true);
|
assoc.setPrimary(true);
|
||||||
|
|
||||||
return (List<NodeIdAndAclId>) template.selectList(SELECT_NODE_PRIMARY_CHILD_ACLS, assoc);
|
return template.selectList(SELECT_NODE_PRIMARY_CHILD_ACLS, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -936,7 +936,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Ordered
|
// Ordered
|
||||||
assoc.setOrdered(false);
|
assoc.setOrdered(false);
|
||||||
|
|
||||||
return (List<ChildAssocEntity>) template.selectList(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
return template.selectList(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1156,7 +1156,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
assoc.setOrdered(false);
|
assoc.setOrdered(false);
|
||||||
|
|
||||||
// Note: This single results was assumed from inception of the original method. It's correct.
|
// Note: This single results was assumed from inception of the original method. It's correct.
|
||||||
return (ChildAssocEntity) template.selectOne(SELECT_CHILD_ASSOC_OF_PARENT_BY_NAME, assoc);
|
return template.selectOne(SELECT_CHILD_ASSOC_OF_PARENT_BY_NAME, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1313,7 +1313,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
// Primary
|
// Primary
|
||||||
assoc.setPrimary(Boolean.TRUE);
|
assoc.setPrimary(Boolean.TRUE);
|
||||||
|
|
||||||
return (List<ChildAssocEntity>) template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
return template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1370,7 +1370,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
childNode.setId(childNodeId);
|
childNode.setId(childNodeId);
|
||||||
assoc.setChildNode(childNode);
|
assoc.setChildNode(childNode);
|
||||||
|
|
||||||
return (List<ChildAssocEntity>) template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
return template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1455,7 +1455,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
TransactionQueryEntity query = new TransactionQueryEntity();
|
TransactionQueryEntity query = new TransactionQueryEntity();
|
||||||
query.setMaxCommitTime(maxCommitTime);
|
query.setMaxCommitTime(maxCommitTime);
|
||||||
|
|
||||||
List<Transaction> txns = (List<Transaction>) template.selectList(SELECT_TXN_LAST, query, new RowBounds(0, 1));
|
List<Transaction> txns = template.selectList(SELECT_TXN_LAST, query, new RowBounds(0, 1));
|
||||||
if (txns.size() > 0)
|
if (txns.size() > 0)
|
||||||
{
|
{
|
||||||
return txns.get(0);
|
return txns.get(0);
|
||||||
@@ -1469,7 +1469,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected int selectTransactionCount()
|
protected int selectTransactionCount()
|
||||||
{
|
{
|
||||||
return (Integer) template.selectOne(SELECT_TXN_COUNT);
|
return template.selectOne(SELECT_TXN_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1478,7 +1478,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
TransactionQueryEntity query = new TransactionQueryEntity();
|
TransactionQueryEntity query = new TransactionQueryEntity();
|
||||||
query.setId(txnId);
|
query.setId(txnId);
|
||||||
|
|
||||||
return (Transaction) template.selectOne(SELECT_TXNS, query);
|
return template.selectOne(SELECT_TXNS, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -1493,7 +1493,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Return List<Node> for quicker node_deleted access
|
// TODO: Return List<Node> for quicker node_deleted access
|
||||||
return (List<NodeEntity>) template.selectList(SELECT_TXN_NODES, query);
|
return template.selectList(SELECT_TXN_NODES, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -1526,11 +1526,11 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
|
|
||||||
if (count == null)
|
if (count == null)
|
||||||
{
|
{
|
||||||
return (List<Transaction>) template.selectList(SELECT_TXNS, query);
|
return template.selectList(SELECT_TXNS, query);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (List<Transaction>) template.selectList(SELECT_TXNS, query, new RowBounds(0, count));
|
return template.selectList(SELECT_TXNS, query, new RowBounds(0, count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1543,11 +1543,11 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
query.setMaxCommitTime(maxCommitTime);
|
query.setMaxCommitTime(maxCommitTime);
|
||||||
if (count == null)
|
if (count == null)
|
||||||
{
|
{
|
||||||
return (List<Long>) template.selectList(SELECT_TXNS_UNUSED, query);
|
return template.selectList(SELECT_TXNS_UNUSED, query);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (List<Long>) template.selectList(SELECT_TXNS_UNUSED, query, new RowBounds(0, count));
|
return template.selectList(SELECT_TXNS_UNUSED, query, new RowBounds(0, count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1564,31 +1564,31 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected Long selectMinTxnCommitTime()
|
protected Long selectMinTxnCommitTime()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_TXN_MIN_COMMIT_TIME);
|
return template.selectOne(SELECT_TXN_MIN_COMMIT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Long selectMaxTxnCommitTime()
|
protected Long selectMaxTxnCommitTime()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_TXN_MAX_COMMIT_TIME);
|
return template.selectOne(SELECT_TXN_MAX_COMMIT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Long selectMinTxnId()
|
protected Long selectMinTxnId()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_TXN_MIN_ID);
|
return template.selectOne(SELECT_TXN_MIN_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Long selectMinUnusedTxnCommitTime()
|
protected Long selectMinUnusedTxnCommitTime()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_TXN_UNUSED_MIN_COMMIT_TIME);
|
return template.selectOne(SELECT_TXN_UNUSED_MIN_COMMIT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Long selectMaxTxnId()
|
protected Long selectMaxTxnId()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_TXN_MAX_ID);
|
return template.selectOne(SELECT_TXN_MAX_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1629,7 +1629,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
ChildAssocEntity childAssoc = new ChildAssocEntity();
|
ChildAssocEntity childAssoc = new ChildAssocEntity();
|
||||||
childAssoc.setParentNode(parentNode);
|
childAssoc.setParentNode(parentNode);
|
||||||
childAssoc.setPrimary(Boolean.valueOf(isPrimary));
|
childAssoc.setPrimary(Boolean.valueOf(isPrimary));
|
||||||
return (Integer)template.selectOne(COUNT_CHILD_ASSOC_BY_PARENT_ID, childAssoc);
|
return template.selectOne(COUNT_CHILD_ASSOC_BY_PARENT_ID, childAssoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1699,7 +1699,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
|||||||
query.setMinCommitTime(fromTimeInclusive);
|
query.setMinCommitTime(fromTimeInclusive);
|
||||||
query.setMaxCommitTime(toTimeExclusive);
|
query.setMaxCommitTime(toTimeExclusive);
|
||||||
query.setExcludeServerId(serverId);
|
query.setExcludeServerId(serverId);
|
||||||
return (List<Transaction>) template.selectList(SELECT_ONE_TXNS_BY_COMMIT_TIME_DESC, query);
|
return template.selectList(SELECT_ONE_TXNS_BY_COMMIT_TIME_DESC, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -62,7 +62,7 @@ public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
|
|||||||
{
|
{
|
||||||
AppliedPatchEntity entity = new AppliedPatchEntity();
|
AppliedPatchEntity entity = new AppliedPatchEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (AppliedPatchEntity) template.selectOne(SELECT_APPLIED_PATCH_BY_ID, entity);
|
entity = template.selectOne(SELECT_APPLIED_PATCH_BY_ID, entity);
|
||||||
// Could be null
|
// Could be null
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,6 @@ public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected List<AppliedPatchEntity> getAppliedPatchEntities()
|
protected List<AppliedPatchEntity> getAppliedPatchEntities()
|
||||||
{
|
{
|
||||||
return (List<AppliedPatchEntity>) template.selectList(SELECT_ALL_APPLIED_PATCH);
|
return template.selectList(SELECT_ALL_APPLIED_PATCH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -153,7 +153,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
|
|
||||||
public long getMaxAdmNodeID()
|
public long getMaxAdmNodeID()
|
||||||
{
|
{
|
||||||
Long count = (Long) template.selectOne(SELECT_ADM_MAX_NODE_ID);
|
Long count = template.selectOne(SELECT_ADM_MAX_NODE_ID);
|
||||||
return count == null ? 0L : count;
|
return count == null ? 0L : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
IdsEntity ids = new IdsEntity();
|
IdsEntity ids = new IdsEntity();
|
||||||
ids.setIdOne(minNodeId);
|
ids.setIdOne(minNodeId);
|
||||||
ids.setIdTwo(maxNodeId);
|
ids.setIdTwo(maxNodeId);
|
||||||
return (List<Map<String, Object>>) template.selectList(SELECT_ADM_OLD_CONTENT_PROPERTIES, ids);
|
return template.selectList(SELECT_ADM_OLD_CONTENT_PROPERTIES, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -210,14 +210,14 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected long getMaxAclEntityId()
|
protected long getMaxAclEntityId()
|
||||||
{
|
{
|
||||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_MAX_ACL_ID, null);
|
Long count = template.selectOne(SELECT_PERMISSIONS_MAX_ACL_ID, null);
|
||||||
return count == null ? 0L : count;
|
return count == null ? 0L : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected long getDmNodeEntitiesCount()
|
protected long getDmNodeEntitiesCount()
|
||||||
{
|
{
|
||||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT, null);
|
Long count = template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT, null);
|
||||||
return count == null ? 0L : count;
|
return count == null ? 0L : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
{
|
{
|
||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", above);
|
params.put("id", above);
|
||||||
Long count = (Long) template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT_WITH_NEW_ACLS, params);
|
Long count = template.selectOne(SELECT_PERMISSIONS_DM_NODE_COUNT_WITH_NEW_ACLS, params);
|
||||||
return count == null ? 0L : count;
|
return count == null ? 0L : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,13 +256,13 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
|
|
||||||
public int getChildAssocCount()
|
public int getChildAssocCount()
|
||||||
{
|
{
|
||||||
return (Integer) template.selectOne(SELECT_CHILD_ASSOCS_COUNT);
|
return template.selectOne(SELECT_CHILD_ASSOCS_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getMaxChildAssocId()
|
public Long getMaxChildAssocId()
|
||||||
{
|
{
|
||||||
Long maxAssocId = (Long) template.selectOne(SELECT_CHILD_ASSOCS_MAX_ID);
|
Long maxAssocId = template.selectOne(SELECT_CHILD_ASSOCS_MAX_ID);
|
||||||
return maxAssocId == null ? 0L : maxAssocId;
|
return maxAssocId == null ? 0L : maxAssocId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,7 +301,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, new RowBounds(0, queryMaxResults));
|
List<Map<String, Object>> rows = template.selectList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, new RowBounds(0, queryMaxResults));
|
||||||
if (results.size() == 0 && rows.size() >= maxResults)
|
if (results.size() == 0 && rows.size() >= maxResults)
|
||||||
{
|
{
|
||||||
// We have all we need
|
// We have all we need
|
||||||
@@ -421,7 +421,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected List<String> getOldAttrCustomNamesImpl()
|
protected List<String> getOldAttrCustomNamesImpl()
|
||||||
{
|
{
|
||||||
return (List<String>)template.selectList(SELECT_OLD_ATTR_CUSTOM_NAMES);
|
return template.selectList(SELECT_OLD_ATTR_CUSTOM_NAMES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -469,7 +469,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getAclsThatInheritFromNonPrimaryParent()
|
public List<Map<String, Object>> getAclsThatInheritFromNonPrimaryParent()
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
List<Map<String, Object>> rows = template.selectList(
|
||||||
SELECT_ACLS_THAT_INHERIT_FROM_NON_PRIMARY_PARENT,
|
SELECT_ACLS_THAT_INHERIT_FROM_NON_PRIMARY_PARENT,
|
||||||
Boolean.TRUE);
|
Boolean.TRUE);
|
||||||
return rows;
|
return rows;
|
||||||
@@ -479,7 +479,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getAclsThatInheritWithInheritanceUnset()
|
public List<Map<String, Object>> getAclsThatInheritWithInheritanceUnset()
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
List<Map<String, Object>> rows = template.selectList(
|
||||||
SELECT_ACLS_THAT_INHERIT_WITH_INHERITANCE_UNSET,
|
SELECT_ACLS_THAT_INHERIT_WITH_INHERITANCE_UNSET,
|
||||||
Boolean.TRUE);
|
Boolean.TRUE);
|
||||||
return rows;
|
return rows;
|
||||||
@@ -489,7 +489,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
public List<Map<String, Object>> getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
List<Map<String, Object>> rows = template.selectList(
|
||||||
SELECT_DEFINING_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
SELECT_DEFINING_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||||
Boolean.TRUE);
|
Boolean.TRUE);
|
||||||
return rows;
|
return rows;
|
||||||
@@ -499,7 +499,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
List<Map<String, Object>> rows = template.selectList(
|
||||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||||
Boolean.TRUE);
|
Boolean.TRUE);
|
||||||
return rows;
|
return rows;
|
||||||
@@ -509,7 +509,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
|
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) template.selectList(
|
List<Map<String, Object>> rows = template.selectList(
|
||||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL,
|
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL,
|
||||||
Boolean.TRUE);
|
Boolean.TRUE);
|
||||||
return rows;
|
return rows;
|
||||||
@@ -526,7 +526,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
}
|
}
|
||||||
IdsEntity params = new IdsEntity();
|
IdsEntity params = new IdsEntity();
|
||||||
params.setIds(new ArrayList<Long>(qnameIds));
|
params.setIds(new ArrayList<Long>(qnameIds));
|
||||||
Long count = (Long) template.selectOne(SELECT_COUNT_NODES_WITH_ASPECTS, params);
|
Long count = template.selectOne(SELECT_COUNT_NODES_WITH_ASPECTS, params);
|
||||||
if (count == null)
|
if (count == null)
|
||||||
{
|
{
|
||||||
return 0L;
|
return 0L;
|
||||||
@@ -546,7 +546,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
params.put("qnameId", typeQNameId);
|
params.put("qnameId", typeQNameId);
|
||||||
params.put("minNodeId", minNodeId);
|
params.put("minNodeId", minNodeId);
|
||||||
params.put("maxNodeId", maxNodeId);
|
params.put("maxNodeId", maxNodeId);
|
||||||
return (List<Long>) template.selectList(SELECT_NODES_BY_TYPE_QNAME, params);
|
return template.selectList(SELECT_NODES_BY_TYPE_QNAME, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -557,7 +557,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
params.put("nsId", nsId);
|
params.put("nsId", nsId);
|
||||||
params.put("minNodeId", minNodeId);
|
params.put("minNodeId", minNodeId);
|
||||||
params.put("maxNodeId", maxNodeId);
|
params.put("maxNodeId", maxNodeId);
|
||||||
return (List<Long>) template.selectList(SELECT_NODES_BY_TYPE_URI, params);
|
return template.selectList(SELECT_NODES_BY_TYPE_URI, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -568,7 +568,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
params.put("qnameId", aspectQNameId);
|
params.put("qnameId", aspectQNameId);
|
||||||
params.put("minNodeId", minNodeId);
|
params.put("minNodeId", minNodeId);
|
||||||
params.put("maxNodeId", maxNodeId);
|
params.put("maxNodeId", maxNodeId);
|
||||||
return (List<Long>) template.selectList(SELECT_NODES_BY_ASPECT_QNAME, params);
|
return template.selectList(SELECT_NODES_BY_ASPECT_QNAME, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -579,7 +579,7 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
params.put("mimetypeId", mimetypeId);
|
params.put("mimetypeId", mimetypeId);
|
||||||
params.put("minNodeId", minNodeId);
|
params.put("minNodeId", minNodeId);
|
||||||
params.put("maxNodeId", maxNodeId);
|
params.put("maxNodeId", maxNodeId);
|
||||||
return (List<Long>) template.selectList(SELECT_NODES_BY_CONTENT_MIMETYPE, params);
|
return template.selectList(SELECT_NODES_BY_CONTENT_MIMETYPE, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -121,7 +121,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aclEntityId);
|
params.put("id", aclEntityId);
|
||||||
|
|
||||||
return (AclEntity)template.selectOne(SELECT_ACL_BY_ID, params);
|
return template.selectOne(SELECT_ACL_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -132,7 +132,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
params.put("id", aclEntityId);
|
params.put("id", aclEntityId);
|
||||||
params.put("bool", true);
|
params.put("bool", true);
|
||||||
|
|
||||||
return (List<Long>)template.selectList(SELECT_ACLS_THAT_INHERIT_FROM_ACL, params);
|
return template.selectList(SELECT_ACLS_THAT_INHERIT_FROM_ACL, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -142,7 +142,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
params.put("name", aclGuid);
|
params.put("name", aclGuid);
|
||||||
params.put("bool", true);
|
params.put("bool", true);
|
||||||
|
|
||||||
return (Long)template.selectOne(SELECT_LATEST_ACL_BY_GUID, params);
|
return template.selectOne(SELECT_LATEST_ACL_BY_GUID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -157,7 +157,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aclEntityId);
|
params.put("id", aclEntityId);
|
||||||
|
|
||||||
return (List<Long>)template.selectList(SELECT_ADM_NODES_BY_ACL, params, new RowBounds(0 , maxResults));
|
return template.selectList(SELECT_ADM_NODES_BY_ACL, params, new RowBounds(0 , maxResults));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -211,7 +211,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aclEntityId);
|
params.put("id", aclEntityId);
|
||||||
|
|
||||||
return (List<AclMemberEntity>) template.selectList(SELECT_ACL_MEMBERS_BY_ACL, params);
|
return template.selectList(SELECT_ACL_MEMBERS_BY_ACL, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -221,7 +221,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("name", authorityName);
|
params.put("name", authorityName);
|
||||||
|
|
||||||
return (List<AclMemberEntity>) template.selectList(SELECT_ACL_MEMBERS_BY_AUTHORITY, params);
|
return template.selectList(SELECT_ACL_MEMBERS_BY_AUTHORITY, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -266,7 +266,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aclChangeSetEntityId);
|
params.put("id", aclChangeSetEntityId);
|
||||||
|
|
||||||
return (AclChangeSetEntity)template.selectOne(SELECT_ACL_CHANGESET_BY_ID, params);
|
return template.selectOne(SELECT_ACL_CHANGESET_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -303,7 +303,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aceEntityId);
|
params.put("id", aceEntityId);
|
||||||
|
|
||||||
return (AceEntity)template.selectOne(SELECT_ACE_BY_ID, params);
|
return template.selectOne(SELECT_ACE_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -315,7 +315,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
params.put("bool", allowed);
|
params.put("bool", allowed);
|
||||||
params.put("int", type.getId());
|
params.put("int", type.getId());
|
||||||
|
|
||||||
return (AceEntity)template.selectOne(SELECT_ACE_WITH_NO_CONTEXT, params);
|
return template.selectOne(SELECT_ACE_WITH_NO_CONTEXT, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", authorityEntityId);
|
params.put("id", authorityEntityId);
|
||||||
|
|
||||||
return (List<Ace>) template.selectList(SELECT_ACES_BY_AUTHORITY, params);
|
return template.selectList(SELECT_ACES_BY_AUTHORITY, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -347,7 +347,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aclEntityId);
|
params.put("id", aclEntityId);
|
||||||
|
|
||||||
return (List<Map<String, Object>>) template.selectList(SELECT_ACES_AND_AUTHORIES_BY_ACL, params);
|
return template.selectList(SELECT_ACES_AND_AUTHORIES_BY_ACL, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -371,7 +371,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", aceContextEntityId);
|
params.put("id", aceContextEntityId);
|
||||||
|
|
||||||
return (AceContextEntity)template.selectOne(SELECT_ACE_CONTEXT_BY_ID, params);
|
return template.selectOne(SELECT_ACE_CONTEXT_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -397,7 +397,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", permissionEntityId);
|
params.put("id", permissionEntityId);
|
||||||
|
|
||||||
return (PermissionEntity)template.selectOne(SELECT_PERMISSION_BY_ID, params);
|
return template.selectOne(SELECT_PERMISSION_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -407,7 +407,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
params.put("id", qnameId);
|
params.put("id", qnameId);
|
||||||
params.put("name", name);
|
params.put("name", name);
|
||||||
|
|
||||||
return (PermissionEntity)template.selectOne(SELECT_PERMISSION_BY_TYPE_AND_NAME, params);
|
return template.selectOne(SELECT_PERMISSION_BY_TYPE_AND_NAME, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -441,7 +441,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", authorityEntityId);
|
params.put("id", authorityEntityId);
|
||||||
|
|
||||||
return (AuthorityEntity)template.selectOne(SELECT_AUTHORITY_BY_ID, params);
|
return template.selectOne(SELECT_AUTHORITY_BY_ID, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -454,7 +454,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
|
|
||||||
// note: allow for list (non-unique name) in case of upgrade of old schemas
|
// note: allow for list (non-unique name) in case of upgrade of old schemas
|
||||||
AuthorityEntity result = null;
|
AuthorityEntity result = null;
|
||||||
List<AuthorityEntity> authorities = (List<AuthorityEntity>)template.selectList(SELECT_AUTHORITY_BY_NAME, params);
|
List<AuthorityEntity> authorities = template.selectList(SELECT_AUTHORITY_BY_NAME, params);
|
||||||
for (AuthorityEntity found : authorities)
|
for (AuthorityEntity found : authorities)
|
||||||
{
|
{
|
||||||
if (found.getAuthority().equals(authorityName))
|
if (found.getAuthority().equals(authorityName))
|
||||||
@@ -520,7 +520,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected Long selectMaxChangeSetCommitTime()
|
protected Long selectMaxChangeSetCommitTime()
|
||||||
{
|
{
|
||||||
return (Long) template.selectOne(SELECT_CHANGE_SET_MAX_COMMIT_TIME);
|
return template.selectOne(SELECT_CHANGE_SET_MAX_COMMIT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ public class AclCrudDAOImpl extends AbstractAclCrudDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("commit_time_ms", maxCommitTime);
|
params.put("commit_time_ms", maxCommitTime);
|
||||||
|
|
||||||
List<Long> sets = (List<Long>) template.selectList(SELECT_CHANGE_SET_LAST, params, new RowBounds(0, 1));
|
List<Long> sets = template.selectList(SELECT_CHANGE_SET_LAST, params, new RowBounds(0, 1));
|
||||||
if (sets.size() > 0)
|
if (sets.size() > 0)
|
||||||
{
|
{
|
||||||
return sets.get(0);
|
return sets.get(0);
|
||||||
|
@@ -40,6 +40,7 @@ import org.alfresco.repo.domain.propval.PropertyValueEntity;
|
|||||||
import org.alfresco.repo.domain.propval.PropertyValueEntity.PersistedType;
|
import org.alfresco.repo.domain.propval.PropertyValueEntity.PersistedType;
|
||||||
import org.alfresco.repo.domain.schema.script.ScriptBundleExecutor;
|
import org.alfresco.repo.domain.schema.script.ScriptBundleExecutor;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
|
import org.apache.ibatis.session.Configuration;
|
||||||
import org.apache.ibatis.session.ResultContext;
|
import org.apache.ibatis.session.ResultContext;
|
||||||
import org.apache.ibatis.session.ResultHandler;
|
import org.apache.ibatis.session.ResultHandler;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
@@ -60,7 +61,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
|
|
||||||
private static final String SELECT_PROPERTY_DATE_VALUE_BY_ID = "alfresco.propval.select_PropertyDateValueByID";
|
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 SELECT_PROPERTY_DATE_VALUE_BY_VALUE = "alfresco.propval.select_PropertyDateValueByValue";
|
||||||
private static final String INSERT_PROPERTY_DATE_VALUE = "alfresco.propval.insert.insert_PropertyDateValue";
|
private static final String INSERT_PROPERTY_DATE_VALUE = "alfresco.propval.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_ID = "alfresco.propval.select_PropertyStringValueByID";
|
||||||
private static final String SELECT_PROPERTY_STRING_VALUE_BY_VALUE = "alfresco.propval.select_PropertyStringValueByValue";
|
private static final String SELECT_PROPERTY_STRING_VALUE_BY_VALUE = "alfresco.propval.select_PropertyStringValueByValue";
|
||||||
@@ -93,7 +94,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
private static final String DELETE_PROPERTY_UNIQUE_CTX_BY_ID = "alfresco.propval.delete_PropertyUniqueContextById";
|
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 DELETE_PROPERTY_UNIQUE_CTX_BY_VALUES = "alfresco.propval.delete_PropertyUniqueContextByValues";
|
||||||
|
|
||||||
private static final String INSERT_PROPERTY_LINK = "alfresco.propval.insert.insert_PropertyLink";
|
private static final String INSERT_PROPERTY_LINK = "alfresco.propval.insert_PropertyLink";
|
||||||
private static final String DELETE_PROPERTY_LINKS_BY_ROOT_ID = "alfresco.propval.delete_PropertyLinksByRootId";
|
private static final String DELETE_PROPERTY_LINKS_BY_ROOT_ID = "alfresco.propval.delete_PropertyLinksByRootId";
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyClassEntity entity = new PropertyClassEntity();
|
PropertyClassEntity entity = new PropertyClassEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (PropertyClassEntity) template.selectOne(
|
entity = template.selectOne(
|
||||||
SELECT_PROPERTY_CLASS_BY_ID,
|
SELECT_PROPERTY_CLASS_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -133,7 +134,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyClassEntity entity = new PropertyClassEntity();
|
PropertyClassEntity entity = new PropertyClassEntity();
|
||||||
entity.setJavaClass(value);
|
entity.setJavaClass(value);
|
||||||
entity = (PropertyClassEntity) template.selectOne(
|
entity = template.selectOne(
|
||||||
SELECT_PROPERTY_CLASS_BY_NAME,
|
SELECT_PROPERTY_CLASS_BY_NAME,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -157,7 +158,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected PropertyDateValueEntity findDateValueById(Long id)
|
protected PropertyDateValueEntity findDateValueById(Long id)
|
||||||
{
|
{
|
||||||
PropertyDateValueEntity entity = (PropertyDateValueEntity) template.selectOne(
|
PropertyDateValueEntity entity = template.selectOne(
|
||||||
SELECT_PROPERTY_DATE_VALUE_BY_ID,
|
SELECT_PROPERTY_DATE_VALUE_BY_ID,
|
||||||
id);
|
id);
|
||||||
// Done
|
// Done
|
||||||
@@ -167,7 +168,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected PropertyDateValueEntity findDateValueByValue(Date value)
|
protected PropertyDateValueEntity findDateValueByValue(Date value)
|
||||||
{
|
{
|
||||||
PropertyDateValueEntity result = (PropertyDateValueEntity) template.selectOne(
|
PropertyDateValueEntity result = template.selectOne(
|
||||||
SELECT_PROPERTY_DATE_VALUE_BY_VALUE,
|
SELECT_PROPERTY_DATE_VALUE_BY_VALUE,
|
||||||
new Long(value.getTime()));
|
new Long(value.getTime()));
|
||||||
// The ID is the actual time in ms (GMT)
|
// The ID is the actual time in ms (GMT)
|
||||||
@@ -193,7 +194,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
String value = (String) template.selectOne(
|
String value = template.selectOne(
|
||||||
SELECT_PROPERTY_STRING_VALUE_BY_ID,
|
SELECT_PROPERTY_STRING_VALUE_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -206,7 +207,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
PropertyStringValueEntity entity = new PropertyStringValueEntity();
|
||||||
entity.setValue(value);
|
entity.setValue(value);
|
||||||
List<Long> rows = (List<Long>) template.selectList(
|
List<Long> rows = template.selectList(
|
||||||
SELECT_PROPERTY_STRING_VALUE_BY_VALUE,
|
SELECT_PROPERTY_STRING_VALUE_BY_VALUE,
|
||||||
entity,
|
entity,
|
||||||
new RowBounds(0, 1));
|
new RowBounds(0, 1));
|
||||||
@@ -241,7 +242,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (PropertyDoubleValueEntity) template.selectOne(
|
entity = template.selectOne(
|
||||||
SELECT_PROPERTY_DOUBLE_VALUE_BY_ID,
|
SELECT_PROPERTY_DOUBLE_VALUE_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -254,7 +255,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
PropertyDoubleValueEntity entity = new PropertyDoubleValueEntity();
|
||||||
entity.setDoubleValue(value);
|
entity.setDoubleValue(value);
|
||||||
List<PropertyDoubleValueEntity> results = (List<PropertyDoubleValueEntity>) template.selectList(
|
List<PropertyDoubleValueEntity> results = template.selectList(
|
||||||
SELECT_PROPERTY_DOUBLE_VALUE_BY_VALUE,
|
SELECT_PROPERTY_DOUBLE_VALUE_BY_VALUE,
|
||||||
entity,
|
entity,
|
||||||
new RowBounds(0, 1));
|
new RowBounds(0, 1));
|
||||||
@@ -289,7 +290,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertySerializableValueEntity entity = new PropertySerializableValueEntity();
|
PropertySerializableValueEntity entity = new PropertySerializableValueEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (PropertySerializableValueEntity) template.selectOne(
|
entity = template.selectOne(
|
||||||
SELECT_PROPERTY_SERIALIZABLE_VALUE_BY_ID,
|
SELECT_PROPERTY_SERIALIZABLE_VALUE_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
// Done
|
// Done
|
||||||
@@ -316,7 +317,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyValueEntity entity = new PropertyValueEntity();
|
PropertyValueEntity entity = new PropertyValueEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
List<PropertyValueEntity> results = (List<PropertyValueEntity>) template.selectList(
|
List<PropertyValueEntity> results = template.selectList(
|
||||||
SELECT_PROPERTY_VALUE_BY_ID,
|
SELECT_PROPERTY_VALUE_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
// At most one of the results represents a real value
|
// At most one of the results represents a real value
|
||||||
@@ -397,7 +398,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
if (query != null)
|
if (query != null)
|
||||||
{
|
{
|
||||||
// Uniqueness is guaranteed by the tables, so we get one value only
|
// Uniqueness is guaranteed by the tables, so we get one value only
|
||||||
result = (PropertyValueEntity) template.selectOne(query, queryObject);
|
result = template.selectOne(query, queryObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
@@ -460,7 +461,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyValueEntity entity = new PropertyValueEntity();
|
PropertyValueEntity entity = new PropertyValueEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
List<PropertyIdSearchRow> results = (List<PropertyIdSearchRow>) template.selectList(
|
List<PropertyIdSearchRow> results = template.selectList(
|
||||||
SELECT_PROPERTY_BY_ID,
|
SELECT_PROPERTY_BY_ID,
|
||||||
entity);
|
entity);
|
||||||
return results;
|
return results;
|
||||||
@@ -483,7 +484,9 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// A row handler to roll up individual rows
|
// A row handler to roll up individual rows
|
||||||
|
Configuration configuration = template.getConfiguration();
|
||||||
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
RollupResultHandler rollupResultHandler = new RollupResultHandler(
|
||||||
|
configuration,
|
||||||
KEY_COLUMNS_FINDBYIDS,
|
KEY_COLUMNS_FINDBYIDS,
|
||||||
"propValues",
|
"propValues",
|
||||||
valueResultHandler);
|
valueResultHandler);
|
||||||
@@ -510,7 +513,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyRootEntity entity = new PropertyRootEntity();
|
PropertyRootEntity entity = new PropertyRootEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
return (PropertyRootEntity) template.selectOne(SELECT_PROPERTY_ROOT_BY_ID, entity);
|
return template.selectOne(SELECT_PROPERTY_ROOT_BY_ID, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -553,7 +556,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
{
|
{
|
||||||
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
|
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (PropertyUniqueContextEntity) template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_ID, entity);
|
entity = template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_ID, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +567,7 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
|
|||||||
entity.setValue1PropId(valueId1);
|
entity.setValue1PropId(valueId1);
|
||||||
entity.setValue2PropId(valueId2);
|
entity.setValue2PropId(valueId2);
|
||||||
entity.setValue3PropId(valueId3);
|
entity.setValue3PropId(valueId3);
|
||||||
entity = (PropertyUniqueContextEntity) template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity);
|
entity = template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
|||||||
{
|
{
|
||||||
NamespaceEntity entity = new NamespaceEntity();
|
NamespaceEntity entity = new NamespaceEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (NamespaceEntity) template.selectOne(SELECT_NS_BY_ID, entity);
|
entity = template.selectOne(SELECT_NS_BY_ID, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
|||||||
{
|
{
|
||||||
NamespaceEntity entity = new NamespaceEntity();
|
NamespaceEntity entity = new NamespaceEntity();
|
||||||
entity.setUriSafe(uri);
|
entity.setUriSafe(uri);
|
||||||
entity = (NamespaceEntity) template.selectOne(SELECT_NS_BY_URI, entity);
|
entity = template.selectOne(SELECT_NS_BY_URI, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
|||||||
{
|
{
|
||||||
QNameEntity entity = new QNameEntity();
|
QNameEntity entity = new QNameEntity();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
entity = (QNameEntity) template.selectOne(SELECT_QNAME_BY_ID, entity);
|
entity = template.selectOne(SELECT_QNAME_BY_ID, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ public class QNameDAOImpl extends AbstractQNameDAOImpl
|
|||||||
QNameEntity entity = new QNameEntity();
|
QNameEntity entity = new QNameEntity();
|
||||||
entity.setNamespaceId(nsId);
|
entity.setNamespaceId(nsId);
|
||||||
entity.setLocalNameSafe(localName);
|
entity.setLocalNameSafe(localName);
|
||||||
entity = (QNameEntity) template.selectOne(SELECT_QNAME_BY_NS_AND_LOCALNAME, entity);
|
entity = template.selectOne(SELECT_QNAME_BY_NS_AND_LOCALNAME, entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,7 +69,7 @@ public class CannedQueryDAOImpl extends AbstractCannedQueryDAOImpl
|
|||||||
String query = makeQueryName(sqlNamespace, queryName);
|
String query = makeQueryName(sqlNamespace, queryName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Long result = (Long) template.selectOne(query, parameterObj);
|
Long result = template.selectOne(query, parameterObj);
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
result = 0L;
|
result = 0L;
|
||||||
|
@@ -96,7 +96,7 @@ public class SOLRDAOImpl implements SOLRDAO
|
|||||||
params.setToIdExclusive(maxAclChangeSetId);
|
params.setToIdExclusive(maxAclChangeSetId);
|
||||||
params.setToCommitTimeExclusive(toCommitTime);
|
params.setToCommitTimeExclusive(toCommitTime);
|
||||||
|
|
||||||
return (List<AclChangeSet>) template.selectList(SELECT_CHANGESETS_SUMMARY, params, new RowBounds(0, maxResults));
|
return template.selectList(SELECT_CHANGESETS_SUMMARY, params, new RowBounds(0, maxResults));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,11 +127,11 @@ public class SOLRDAOImpl implements SOLRDAO
|
|||||||
List<Acl> source;
|
List<Acl> source;
|
||||||
if (maxResults <= 0 || maxResults == Integer.MAX_VALUE)
|
if (maxResults <= 0 || maxResults == Integer.MAX_VALUE)
|
||||||
{
|
{
|
||||||
source = (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params);
|
source = template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
source = (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params, new RowBounds(0, maxResults));
|
source = template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params, new RowBounds(0, maxResults));
|
||||||
}
|
}
|
||||||
// Add any unlinked shared ACLs from defining nodes to index them now
|
// Add any unlinked shared ACLs from defining nodes to index them now
|
||||||
TreeSet<Acl> sorted = new TreeSet<Acl>(source);
|
TreeSet<Acl> sorted = new TreeSet<Acl>(source);
|
||||||
@@ -183,7 +183,7 @@ public class SOLRDAOImpl implements SOLRDAO
|
|||||||
params.setToIdExclusive(maxTxnId);
|
params.setToIdExclusive(maxTxnId);
|
||||||
params.setToCommitTimeExclusive(toCommitTime);
|
params.setToCommitTimeExclusive(toCommitTime);
|
||||||
|
|
||||||
return (List<Transaction>) template.selectList(SELECT_TRANSACTIONS, params, new RowBounds(0, maxResults));
|
return template.selectList(SELECT_TRANSACTIONS, params, new RowBounds(0, maxResults));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -196,13 +196,13 @@ public class SOLRDAOImpl implements SOLRDAO
|
|||||||
|
|
||||||
if(nodeParameters.getMaxResults() != 0 && nodeParameters.getMaxResults() != Integer.MAX_VALUE)
|
if(nodeParameters.getMaxResults() != 0 && nodeParameters.getMaxResults() != Integer.MAX_VALUE)
|
||||||
{
|
{
|
||||||
return (List<Node>) template.selectList(
|
return template.selectList(
|
||||||
SELECT_NODES, params,
|
SELECT_NODES, params,
|
||||||
new RowBounds(0, nodeParameters.getMaxResults()));
|
new RowBounds(0, nodeParameters.getMaxResults()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (List<Node>) template.selectList(SELECT_NODES, params);
|
return template.selectList(SELECT_NODES, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
: pagingRequest.getMaxItems() + 1);
|
: pagingRequest.getMaxItems() + 1);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<SubscriptionNodeEntity> nodeList = (List<SubscriptionNodeEntity>) template.selectList(
|
List<SubscriptionNodeEntity> nodeList = template.selectList(
|
||||||
"alfresco.subscriptions.select_Subscriptions", map, new RowBounds(pagingRequest.getSkipCount(),
|
"alfresco.subscriptions.select_Subscriptions", map, new RowBounds(pagingRequest.getSkipCount(),
|
||||||
maxItems + 1));
|
maxItems + 1));
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put("userNodeId", dbid);
|
map.put("userNodeId", dbid);
|
||||||
|
|
||||||
Number count = (Number) template.selectOne("alfresco.subscriptions.select_countSubscriptions", map);
|
Number count = template.selectOne("alfresco.subscriptions.select_countSubscriptions", map);
|
||||||
return count == null ? 0 : count.intValue();
|
return count == null ? 0 : count.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
se.setUserNodeId(dbid);
|
se.setUserNodeId(dbid);
|
||||||
se.setNodeId(nodedbid);
|
se.setNodeId(nodedbid);
|
||||||
|
|
||||||
Number count = (Number) template.selectOne("alfresco.subscriptions.select_hasSubscribed", se);
|
Number count = template.selectOne("alfresco.subscriptions.select_hasSubscribed", se);
|
||||||
if (count == null || count.intValue() == 0)
|
if (count == null || count.intValue() == 0)
|
||||||
{
|
{
|
||||||
template.insert("alfresco.subscriptions.insert_Subscription", se);
|
template.insert("alfresco.subscriptions.insert_Subscription", se);
|
||||||
@@ -228,7 +228,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
se.setUserNodeId(dbid);
|
se.setUserNodeId(dbid);
|
||||||
se.setNodeId(nodedbid);
|
se.setNodeId(nodedbid);
|
||||||
|
|
||||||
Number count = (Number) template.selectOne("alfresco.subscriptions.select_hasSubscribed", se);
|
Number count = template.selectOne("alfresco.subscriptions.select_hasSubscribed", se);
|
||||||
return count == null ? false : count.intValue() > 0;
|
return count == null ? false : count.intValue() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
: pagingRequest.getMaxItems() + 1);
|
: pagingRequest.getMaxItems() + 1);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<String> userList = (List<String>) template.selectList("alfresco.subscriptions.select_Following", map,
|
List<String> userList = template.selectList("alfresco.subscriptions.select_Following", map,
|
||||||
new RowBounds(pagingRequest.getSkipCount(), maxItems + 1));
|
new RowBounds(pagingRequest.getSkipCount(), maxItems + 1));
|
||||||
|
|
||||||
boolean hasMore = userList.size() > maxItems;
|
boolean hasMore = userList.size() > maxItems;
|
||||||
@@ -310,7 +310,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
: pagingRequest.getMaxItems() + 1);
|
: pagingRequest.getMaxItems() + 1);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<String> userList = (List<String>) template.selectList("alfresco.subscriptions.select_Followers", map,
|
List<String> userList = template.selectList("alfresco.subscriptions.select_Followers", map,
|
||||||
new RowBounds(pagingRequest.getSkipCount(), maxItems + 1));
|
new RowBounds(pagingRequest.getSkipCount(), maxItems + 1));
|
||||||
|
|
||||||
boolean hasMore = userList.size() > maxItems;
|
boolean hasMore = userList.size() > maxItems;
|
||||||
@@ -347,7 +347,7 @@ public class SubscriptionsDAOImpl extends AbstractSubscriptionsDAO
|
|||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put("userNodeId", dbid);
|
map.put("userNodeId", dbid);
|
||||||
|
|
||||||
Number count = (Number) template.selectOne("alfresco.subscriptions.select_countFollowers", map);
|
Number count = template.selectOne("alfresco.subscriptions.select_countFollowers", map);
|
||||||
return count == null ? 0 : count.intValue();
|
return count == null ? 0 : count.intValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -63,7 +63,7 @@ public class TenantAdminDAOImpl extends AbstractTenantAdminDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("tenantDomain", tenantDomain);
|
params.put("tenantDomain", tenantDomain);
|
||||||
|
|
||||||
return (TenantEntity)template.selectOne(SELECT_TENANT, params);
|
return template.selectOne(SELECT_TENANT, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -72,7 +72,7 @@ public class TenantAdminDAOImpl extends AbstractTenantAdminDAOImpl
|
|||||||
{
|
{
|
||||||
TenantQueryEntity entity = new TenantQueryEntity();
|
TenantQueryEntity entity = new TenantQueryEntity();
|
||||||
entity.setEnabled(enabled);
|
entity.setEnabled(enabled);
|
||||||
return (List<TenantEntity>)template.selectList(SELECT_TENANTS, entity);
|
return template.selectList(SELECT_TENANTS, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -83,14 +83,14 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
|||||||
Map<String, Object> params = new HashMap<String, Object>(1);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
params.put("id", nodeEntityId);
|
params.put("id", nodeEntityId);
|
||||||
|
|
||||||
return (UsageDeltaEntity) template.selectOne(SELECT_USAGE_DELTA_TOTAL_SIZE_BY_NODE, params);
|
return template.selectOne(SELECT_USAGE_DELTA_TOTAL_SIZE_BY_NODE, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected List<Long> selectUsageDeltaNodes()
|
protected List<Long> selectUsageDeltaNodes()
|
||||||
{
|
{
|
||||||
return (List<Long>) template.selectList(SELECT_USAGE_DELTA_NODES);
|
return template.selectList(SELECT_USAGE_DELTA_NODES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -228,7 +228,7 @@ public class UsageDAOImpl extends AbstractUsageDAOImpl
|
|||||||
params.put("userName2", userName);
|
params.put("userName2", userName);
|
||||||
|
|
||||||
// Query for the 'new' (FK) style content data properties (stored in 'string_value')
|
// Query for the 'new' (FK) style content data properties (stored in 'string_value')
|
||||||
return (Long)template.selectOne(SELECT_CONTENT_SIZE_NEW_USER, params);
|
return template.selectOne(SELECT_CONTENT_SIZE_NEW_USER, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -180,7 +180,7 @@ public class DBQueryEngine implements QueryEngine
|
|||||||
dbQuery.setSinceTxId(sinceTxId);
|
dbQuery.setSinceTxId(sinceTxId);
|
||||||
|
|
||||||
dbQuery.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectorGroup, null, functionContext);
|
dbQuery.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectorGroup, null, functionContext);
|
||||||
List<Node> nodes = (List<Node>)template.selectList(SELECT_BY_DYNAMIC_QUERY, dbQuery);
|
List<Node> nodes = template.selectList(SELECT_BY_DYNAMIC_QUERY, dbQuery);
|
||||||
LinkedHashSet<Long> set = new LinkedHashSet<Long>(nodes.size());
|
LinkedHashSet<Long> set = new LinkedHashSet<Long>(nodes.size());
|
||||||
for(Node node : nodes)
|
for(Node node : nodes)
|
||||||
{
|
{
|
||||||
|
@@ -54,7 +54,7 @@ public class AuthorityBridgeDAOImpl extends AbstractAuthorityBridgeDAO
|
|||||||
|
|
||||||
AuthorityBridgeParametersEntity authorityBridgeParametersEntity = new AuthorityBridgeParametersEntity(authorityContainerTypeQNameId, memberAssocQNameId, authorityNameQNameId, storeId);
|
AuthorityBridgeParametersEntity authorityBridgeParametersEntity = new AuthorityBridgeParametersEntity(authorityContainerTypeQNameId, memberAssocQNameId, authorityNameQNameId, storeId);
|
||||||
|
|
||||||
List<AuthorityBridgeLink> links = (List<AuthorityBridgeLink>) template.selectList(QUERY_SELECT_GET_AUTHORITY_BRIDGE_ENTRIES, authorityBridgeParametersEntity);
|
List<AuthorityBridgeLink> links = template.selectList(QUERY_SELECT_GET_AUTHORITY_BRIDGE_ENTRIES, authorityBridgeParametersEntity);
|
||||||
|
|
||||||
if (start != null)
|
if (start != null)
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ public class AuthorityBridgeDAOImpl extends AbstractAuthorityBridgeDAO
|
|||||||
|
|
||||||
AuthorityBridgeParametersEntity authorityBridgeParametersEntity = new AuthorityBridgeParametersEntity(authorityContainerTypeQNameId, memberAssocQNameId, authorityNameQNameId, storeId, nodeId);
|
AuthorityBridgeParametersEntity authorityBridgeParametersEntity = new AuthorityBridgeParametersEntity(authorityContainerTypeQNameId, memberAssocQNameId, authorityNameQNameId, storeId, nodeId);
|
||||||
|
|
||||||
List<AuthorityBridgeLink> links = (List<AuthorityBridgeLink>) template.selectList(QUERY_SELECT_GET_DIRECT_AUTHORITIES_FOR_UESR, authorityBridgeParametersEntity);
|
List<AuthorityBridgeLink> links = template.selectList(QUERY_SELECT_GET_DIRECT_AUTHORITIES_FOR_UESR, authorityBridgeParametersEntity);
|
||||||
|
|
||||||
if (start != null)
|
if (start != null)
|
||||||
{
|
{
|
||||||
|
@@ -19,10 +19,8 @@
|
|||||||
package org.alfresco.repo.tenant;
|
package org.alfresco.repo.tenant;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.SQLFeatureNotSupportedException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
@@ -124,11 +122,5 @@ public class TenantRoutingDataSource extends AbstractRoutingDataSource
|
|||||||
|
|
||||||
super.afterPropertiesSet(); // to update resolved data sources
|
super.afterPropertiesSet(); // to update resolved data sources
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Logger getParentLogger() throws SQLFeatureNotSupportedException
|
|
||||||
{
|
|
||||||
throw new SQLFeatureNotSupportedException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
<!-- MyBatis config for Alfresco testing (using common datasource) -->
|
<!-- MyBatis config for Alfresco testing (using common datasource) -->
|
||||||
<bean id="repoSqlSessionFactoryTesting" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean">
|
<bean id="repoSqlSessionFactoryTesting" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean">
|
||||||
<property name="useLocalCaches" value="${mybatis.useLocalCaches}"/>
|
|
||||||
<property name="resourceLoader" ref="dialectResourceLoader"/>
|
<property name="resourceLoader" ref="dialectResourceLoader"/>
|
||||||
<property name="dataSource" ref="dataSource"/>
|
<property name="dataSource" ref="dataSource"/>
|
||||||
<property name="mapperLocations">
|
<property name="mapperLocations">
|
||||||
|
Reference in New Issue
Block a user