Fixed unreported bug where index recovery was using unused 'deleted' column.

Fixed queries
  Removed 'deleted' column
  TODO: Fix DB upgrade scripts to not contain the column (minor)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3215 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-06-23 11:10:04 +00:00
parent fe439b54c7
commit eb55d8f625
3 changed files with 19 additions and 19 deletions

View File

@@ -156,7 +156,6 @@
unique="false" unique="false"
not-null="false" /> not-null="false" />
<property name="changeTxnId" column="change_txn_id" type="string" length="56" not-null="true" /> <property name="changeTxnId" column="change_txn_id" type="string" length="56" not-null="true" />
<property name="deleted" column="deleted" type="boolean" not-null="true" />
</class> </class>
<class <class
@@ -285,7 +284,7 @@
where where
status.key.protocol = :storeProtocol and status.key.protocol = :storeProtocol and
status.key.identifier = :storeIdentifier and status.key.identifier = :storeIdentifier and
status.deleted = :deleted and status.node.id is not null and
status.changeTxnId = :changeTxnId status.changeTxnId = :changeTxnId
</query> </query>
@@ -297,7 +296,19 @@
where where
status.key.protocol = :storeProtocol and status.key.protocol = :storeProtocol and
status.key.identifier = :storeIdentifier and status.key.identifier = :storeIdentifier and
status.deleted = :deleted and status.node.id is not null and
status.changeTxnId = :changeTxnId
</query>
<query name="node.GetDeletedNodeStatuses">
select
status
from
org.alfresco.repo.domain.hibernate.NodeStatusImpl as status
where
status.key.protocol = :storeProtocol and
status.key.identifier = :storeIdentifier and
status.node.id is null and
status.changeTxnId = :changeTxnId status.changeTxnId = :changeTxnId
</query> </query>

View File

@@ -99,13 +99,4 @@ public class NodeStatusImpl implements NodeStatus, Serializable
{ {
return (node == null); return (node == null);
} }
/**
* For Hibernate use
*/
@SuppressWarnings("unused")
private void setDeleted(boolean deleted)
{
// this is a convenience, derived property
}
} }

View File

@@ -80,6 +80,7 @@ public class FullIndexRecoveryComponent extends HibernateDaoSupport implements I
{ {
public static final String QUERY_GET_NEXT_CHANGE_TXN_IDS = "node.GetNextChangeTxnIds"; public static final String QUERY_GET_NEXT_CHANGE_TXN_IDS = "node.GetNextChangeTxnIds";
public static final String QUERY_GET_CHANGED_NODE_STATUSES = "node.GetChangedNodeStatuses"; public static final String QUERY_GET_CHANGED_NODE_STATUSES = "node.GetChangedNodeStatuses";
public static final String QUERY_GET_DELETED_NODE_STATUSES = "node.GetDeletedNodeStatuses";
public static final String QUERY_GET_CHANGED_NODE_STATUSES_COUNT = "node.GetChangedNodeStatusesCount"; public static final String QUERY_GET_CHANGED_NODE_STATUSES_COUNT = "node.GetChangedNodeStatusesCount";
private static final String START_TXN_ID = "000"; private static final String START_TXN_ID = "000";
@@ -705,8 +706,7 @@ public class FullIndexRecoveryComponent extends HibernateDaoSupport implements I
public Object doInHibernate(Session session) public Object doInHibernate(Session session)
{ {
Query query = session.getNamedQuery(QUERY_GET_CHANGED_NODE_STATUSES_COUNT); Query query = session.getNamedQuery(QUERY_GET_CHANGED_NODE_STATUSES_COUNT);
query.setBoolean("deleted", false) query.setString("storeProtocol", storeRef.getProtocol())
.setString("storeProtocol", storeRef.getProtocol())
.setString("storeIdentifier", storeRef.getIdentifier()) .setString("storeIdentifier", storeRef.getIdentifier())
.setString("changeTxnId", changeTxnId) .setString("changeTxnId", changeTxnId)
.setReadOnly(true); .setReadOnly(true);
@@ -726,8 +726,7 @@ public class FullIndexRecoveryComponent extends HibernateDaoSupport implements I
public Object doInHibernate(Session session) public Object doInHibernate(Session session)
{ {
Query query = session.getNamedQuery(QUERY_GET_CHANGED_NODE_STATUSES); Query query = session.getNamedQuery(QUERY_GET_CHANGED_NODE_STATUSES);
query.setBoolean("deleted", false) query.setString("storeProtocol", storeRef.getProtocol())
.setString("storeProtocol", storeRef.getProtocol())
.setString("storeIdentifier", storeRef.getIdentifier()) .setString("storeIdentifier", storeRef.getIdentifier())
.setString("changeTxnId", changeTxnId) .setString("changeTxnId", changeTxnId)
.setReadOnly(true); .setReadOnly(true);
@@ -746,9 +745,8 @@ public class FullIndexRecoveryComponent extends HibernateDaoSupport implements I
{ {
public Object doInHibernate(Session session) public Object doInHibernate(Session session)
{ {
Query query = session.getNamedQuery(QUERY_GET_CHANGED_NODE_STATUSES); Query query = session.getNamedQuery(QUERY_GET_DELETED_NODE_STATUSES);
query.setBoolean("deleted", true) query.setString("storeProtocol", storeRef.getProtocol())
.setString("storeProtocol", storeRef.getProtocol())
.setString("storeIdentifier", storeRef.getIdentifier()) .setString("storeIdentifier", storeRef.getIdentifier())
.setString("changeTxnId", changeTxnId) .setString("changeTxnId", changeTxnId)
.setReadOnly(true); .setReadOnly(true);