mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
7633: Fixed compilation fallout from PropertyValue changes 7640: Build Fix - missing purges for some stores 7645: Fixed line endings 7646: Tweaks to MySQL QName upgrade script after doing large 1.4.3 to 2.2 upgrade. 7648: Give more time per thread to cater for slow executions of test threads 7649: Fixed QName query flush modes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8440 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,29 +21,29 @@ ALTER TABLE alf_acl_member DROP INDEX fk_alf_aclm_ace, DROP FOREIGN KEY fk_alf_a
|
|||||||
|
|
||||||
ALTER TABLE alf_attributes DROP INDEX fk_attributes_n_acl, DROP FOREIGN KEY fk_attributes_n_acl; -- (optional)
|
ALTER TABLE alf_attributes DROP INDEX fk_attributes_n_acl, DROP FOREIGN KEY fk_attributes_n_acl; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_woy_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_woy_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_date_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_date_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_y_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_y_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_q_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_q_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_m_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_m_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_dow_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_dow_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_doy_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_doy_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_dom_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_dom_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_hy_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_hy_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_date DROP INDEX adt_wom_idx;
|
ALTER TABLE alf_audit_date DROP INDEX adt_wom_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_fact DROP INDEX adt_user_idx;
|
ALTER TABLE alf_audit_fact DROP INDEX adt_user_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_fact DROP INDEX adt_store_idx;
|
ALTER TABLE alf_audit_fact DROP INDEX adt_store_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_fact DROP INDEX FKEAD18174A0F9B8D9, DROP FOREIGN KEY FKEAD18174A0F9B8D9;
|
ALTER TABLE alf_audit_fact DROP INDEX FKEAD18174A0F9B8D9, DROP FOREIGN KEY FKEAD18174A0F9B8D9;
|
||||||
|
|
||||||
@@ -51,11 +51,11 @@ ALTER TABLE alf_audit_fact DROP INDEX FKEAD1817484342E39, DROP FOREIGN KEY FKEAD
|
|||||||
|
|
||||||
ALTER TABLE alf_audit_fact DROP INDEX FKEAD18174F524CFD7, DROP FOREIGN KEY FKEAD18174F524CFD7;
|
ALTER TABLE alf_audit_fact DROP INDEX FKEAD18174F524CFD7, DROP FOREIGN KEY FKEAD18174F524CFD7;
|
||||||
|
|
||||||
ALTER TABLE alf_audit_source DROP INDEX app_source_app_idx;
|
ALTER TABLE alf_audit_source DROP INDEX app_source_app_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_source DROP INDEX app_source_ser_idx;
|
ALTER TABLE alf_audit_source DROP INDEX app_source_ser_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_audit_source DROP INDEX app_source_met_idx;
|
ALTER TABLE alf_audit_source DROP INDEX app_source_met_idx; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE alf_child_assoc DROP INDEX FKFFC5468E8E50E582, DROP FOREIGN KEY FKFFC5468E8E50E582;
|
ALTER TABLE alf_child_assoc DROP INDEX FKFFC5468E8E50E582, DROP FOREIGN KEY FKFFC5468E8E50E582;
|
||||||
|
|
||||||
@@ -96,45 +96,45 @@ ALTER TABLE alf_transaction DROP INDEX idx_commit_time_ms; -- (optional)
|
|||||||
|
|
||||||
ALTER TABLE alf_transaction DROP INDEX FKB8761A3A9AE340B7, DROP FOREIGN KEY FKB8761A3A9AE340B7;
|
ALTER TABLE alf_transaction DROP INDEX FKB8761A3A9AE340B7, DROP FOREIGN KEY FKB8761A3A9AE340B7;
|
||||||
|
|
||||||
ALTER TABLE avm_aspects DROP INDEX fk_avm_asp_node, DROP FOREIGN KEY fk_avm_asp_node;
|
ALTER TABLE avm_aspects DROP INDEX fk_avm_asp_node, DROP FOREIGN KEY fk_avm_asp_node; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_aspects_new DROP INDEX FKD3FD9F95EDCD4A96, DROP FOREIGN KEY FKD3FD9F95EDCD4A96; -- (optional)
|
ALTER TABLE avm_aspects_new DROP INDEX FKD3FD9F95EDCD4A96, DROP FOREIGN KEY FKD3FD9F95EDCD4A96; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_child, DROP FOREIGN KEY fk_avm_ce_child;
|
ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_child, DROP FOREIGN KEY fk_avm_ce_child; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_parent, DROP FOREIGN KEY fk_avm_ce_parent;
|
ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_parent, DROP FOREIGN KEY fk_avm_ce_parent; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_desc, DROP FOREIGN KEY fk_avm_hl_desc;
|
ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_desc, DROP FOREIGN KEY fk_avm_hl_desc; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_ancestor, DROP FOREIGN KEY fk_avm_hl_ancestor;
|
ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_ancestor, DROP FOREIGN KEY fk_avm_hl_ancestor; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_to, DROP FOREIGN KEY fk_avm_ml_to;
|
ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_to, DROP FOREIGN KEY fk_avm_ml_to; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_from, DROP FOREIGN KEY fk_avm_ml_from;
|
ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_from, DROP FOREIGN KEY fk_avm_ml_from; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_node_properties DROP INDEX idx_avm_np_name;
|
ALTER TABLE avm_node_properties DROP INDEX idx_avm_np_name; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_node_properties DROP INDEX fk_avm_np_node, DROP FOREIGN KEY fk_avm_np_node;
|
ALTER TABLE avm_node_properties DROP INDEX fk_avm_np_node, DROP FOREIGN KEY fk_avm_np_node; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_node_properties_new DROP INDEX FK44A37C8A6BD529F3, DROP FOREIGN KEY FK44A37C8A6BD529F3; -- (optional)
|
ALTER TABLE avm_node_properties_new DROP INDEX FK44A37C8A6BD529F3, DROP FOREIGN KEY FK44A37C8A6BD529F3; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE avm_nodes DROP INDEX fk_avm_n_acl, DROP FOREIGN KEY fk_avm_n_acl;
|
ALTER TABLE avm_nodes DROP INDEX fk_avm_n_acl, DROP FOREIGN KEY fk_avm_n_acl; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_nodes DROP INDEX fk_avm_n_store, DROP FOREIGN KEY fk_avm_n_store;
|
ALTER TABLE avm_nodes DROP INDEX fk_avm_n_store, DROP FOREIGN KEY fk_avm_n_store; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_store_properties DROP INDEX idx_avm_sp_name;
|
ALTER TABLE avm_store_properties DROP INDEX idx_avm_sp_name; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_store_properties DROP INDEX fk_avm_sp_store, DROP FOREIGN KEY fk_avm_sp_store;
|
ALTER TABLE avm_store_properties DROP INDEX fk_avm_sp_store, DROP FOREIGN KEY fk_avm_sp_store; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_stores DROP INDEX fk_avm_s_root, DROP FOREIGN KEY fk_avm_s_root;
|
ALTER TABLE avm_stores DROP INDEX fk_avm_s_root, DROP FOREIGN KEY fk_avm_s_root; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_version_layered_node_entry DROP INDEX FK182E672DEB9D70C, DROP FOREIGN KEY FK182E672DEB9D70C; -- (optional)
|
ALTER TABLE avm_version_layered_node_entry DROP INDEX FK182E672DEB9D70C, DROP FOREIGN KEY FK182E672DEB9D70C; -- (optional)
|
||||||
|
|
||||||
ALTER TABLE avm_version_roots DROP INDEX idx_avm_vr_version;
|
ALTER TABLE avm_version_roots DROP INDEX idx_avm_vr_version; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_root, DROP FOREIGN KEY fk_avm_vr_root;
|
ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_root, DROP FOREIGN KEY fk_avm_vr_root; --(optional)
|
||||||
|
|
||||||
ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_store, DROP FOREIGN KEY fk_avm_vr_store;
|
ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_store, DROP FOREIGN KEY fk_avm_vr_store; --(optional)
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Record script finish
|
-- Record script finish
|
||||||
|
@@ -79,35 +79,35 @@ CREATE INDEX tidx_tqn_ln ON t_qnames (localname);
|
|||||||
-- Populate the table with all known static QNames
|
-- Populate the table with all known static QNames
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT type_qname FROM alf_node
|
SELECT DISTINCT type_qname FROM alf_node
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT qname FROM alf_node_aspects
|
SELECT DISTINCT qname FROM alf_node_aspects
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT qname FROM alf_node_properties
|
SELECT DISTINCT qname FROM alf_node_properties
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT name FROM avm_aspects_new
|
SELECT DISTINCT name FROM avm_aspects_new
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT qname FROM avm_node_properties_new
|
SELECT DISTINCT qname FROM avm_node_properties_new
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT qname FROM avm_store_properties
|
SELECT DISTINCT qname FROM avm_store_properties
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT type_qname FROM alf_node_assoc
|
SELECT DISTINCT type_qname FROM alf_node_assoc
|
||||||
);
|
);
|
||||||
INSERT INTO t_qnames (qname)
|
INSERT INTO t_qnames (qname)
|
||||||
(
|
(
|
||||||
SELECT type_qname FROM alf_child_assoc
|
SELECT DISTINCT type_qname FROM alf_child_assoc
|
||||||
);
|
);
|
||||||
-- Extract the namespace and localnames from the QNames
|
-- Extract the namespace and localnames from the QNames
|
||||||
UPDATE t_qnames SET namespace = SUBSTR(SUBSTRING_INDEX(qname, '}', 1), 2);
|
UPDATE t_qnames SET namespace = SUBSTR(SUBSTRING_INDEX(qname, '}', 1), 2);
|
||||||
@@ -159,6 +159,8 @@ ALTER TABLE alf_node MODIFY COLUMN type_qname_id BIGINT NOT NULL AFTER uuid;
|
|||||||
|
|
||||||
--
|
--
|
||||||
-- DATA REPLACEMENT: alf_node_aspects.qname
|
-- DATA REPLACEMENT: alf_node_aspects.qname
|
||||||
|
-- Due to the the potentially-missing primary key on the original table, it is
|
||||||
|
-- possible to have duplicates. These are removed.
|
||||||
--
|
--
|
||||||
ALTER TABLE alf_node_aspects DROP PRIMARY KEY; -- (optional)
|
ALTER TABLE alf_node_aspects DROP PRIMARY KEY; -- (optional)
|
||||||
ALTER TABLE alf_node_aspects ADD COLUMN qname_id BIGINT NULL AFTER node_id;
|
ALTER TABLE alf_node_aspects ADD COLUMN qname_id BIGINT NULL AFTER node_id;
|
||||||
@@ -171,6 +173,33 @@ UPDATE alf_node_aspects na set na.qname_id =
|
|||||||
);
|
);
|
||||||
ALTER TABLE alf_node_aspects DROP COLUMN qname;
|
ALTER TABLE alf_node_aspects DROP COLUMN qname;
|
||||||
ALTER TABLE alf_node_aspects MODIFY COLUMN qname_id BIGINT NOT NULL AFTER node_id;
|
ALTER TABLE alf_node_aspects MODIFY COLUMN qname_id BIGINT NOT NULL AFTER node_id;
|
||||||
|
CREATE TABLE t_dup_aspects
|
||||||
|
(
|
||||||
|
node_id BIGINT NOT NULL,
|
||||||
|
qname_id BIGINT NOT NULL
|
||||||
|
);
|
||||||
|
INSERT INTO t_dup_aspects (node_id, qname_id)
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
node_id, qname_id
|
||||||
|
FROM
|
||||||
|
alf_node_aspects
|
||||||
|
GROUP BY
|
||||||
|
node_id, qname_id
|
||||||
|
HAVING
|
||||||
|
count(*) > 1
|
||||||
|
);
|
||||||
|
DELETE FROM alf_node_aspects na
|
||||||
|
USING alf_node_aspects na
|
||||||
|
JOIN t_dup_aspects t ON (t.node_id = na.node_id AND t.qname_id = na.qname_id);
|
||||||
|
INSERT INTO alf_node_aspects (node_id, qname_id)
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
node_id, qname_id
|
||||||
|
FROM
|
||||||
|
t_dup_aspects
|
||||||
|
);
|
||||||
|
DROP TABLE t_dup_aspects;
|
||||||
ALTER TABLE alf_node_aspects ADD PRIMARY KEY (node_id, qname_id);
|
ALTER TABLE alf_node_aspects ADD PRIMARY KEY (node_id, qname_id);
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@@ -428,6 +428,13 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName + "-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-a");
|
||||||
|
avmService.purgeStore(storeName + "-layer-b");
|
||||||
|
avmService.purgeStore(storeName + "-layer-c");
|
||||||
|
avmService.purgeStore(storeName + "-layer-d");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-layer-base");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -589,6 +596,13 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName + "-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-a");
|
||||||
|
avmService.purgeStore(storeName + "-layer-b");
|
||||||
|
avmService.purgeStore(storeName + "-layer-c");
|
||||||
|
avmService.purgeStore(storeName + "-layer-d");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-layer-base");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -742,6 +756,13 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName + "-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-a");
|
||||||
|
avmService.purgeStore(storeName + "-layer-b");
|
||||||
|
avmService.purgeStore(storeName + "-layer-c");
|
||||||
|
avmService.purgeStore(storeName + "-layer-d");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-base");
|
||||||
|
avmService.purgeStore(storeName + "-layer-layer-layer-base");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1622,6 +1643,8 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName+"-a-");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1988,6 +2011,7 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName+"-a-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2306,6 +2330,7 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName+"-a-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2383,6 +2408,7 @@ public class AVMServicePermissionsTest extends TestCase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
avmService.purgeStore(storeName);
|
avmService.purgeStore(storeName);
|
||||||
|
avmService.purgeStore(storeName+"-a-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -771,6 +771,14 @@ public class PropertyValue implements Cloneable, Serializable
|
|||||||
return actualType == null ? null : actualType.getOrdinalNumber();
|
return actualType == null ? null : actualType.getOrdinalNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Returns the actual type's String representation
|
||||||
|
*/
|
||||||
|
public String getActualTypeString()
|
||||||
|
{
|
||||||
|
return actualType == null ? null : actualType.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public void setActualType(Integer actualType)
|
public void setActualType(Integer actualType)
|
||||||
{
|
{
|
||||||
ValueType type = PropertyValue.valueTypesByOrdinalNumber.get(actualType);
|
ValueType type = PropertyValue.valueTypesByOrdinalNumber.get(actualType);
|
||||||
|
@@ -200,8 +200,8 @@ public class QNameDAOTest extends TestCase
|
|||||||
readyLatch.await(5, TimeUnit.SECONDS);
|
readyLatch.await(5, TimeUnit.SECONDS);
|
||||||
// Let the threads go
|
// Let the threads go
|
||||||
startLatch.countDown();
|
startLatch.countDown();
|
||||||
// Wait for them all to be done (within limits)
|
// Wait for them all to be done (within limit of 10 seconds per thread)
|
||||||
doneLatch.await(threadCount, TimeUnit.SECONDS);
|
doneLatch.await(threadCount * 10, TimeUnit.SECONDS);
|
||||||
if (doneLatch.getCount() > 0)
|
if (doneLatch.getCount() > 0)
|
||||||
{
|
{
|
||||||
fail("Still waiting for threads to finish");
|
fail("Still waiting for threads to finish");
|
||||||
|
@@ -35,6 +35,8 @@ import org.alfresco.repo.domain.NamespaceEntity;
|
|||||||
import org.alfresco.repo.domain.QNameDAO;
|
import org.alfresco.repo.domain.QNameDAO;
|
||||||
import org.alfresco.repo.domain.QNameEntity;
|
import org.alfresco.repo.domain.QNameEntity;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.springframework.orm.hibernate3.HibernateCallback;
|
import org.springframework.orm.hibernate3.HibernateCallback;
|
||||||
@@ -48,6 +50,8 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
|||||||
*/
|
*/
|
||||||
public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameDAO
|
public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameDAO
|
||||||
{
|
{
|
||||||
|
private static Log logger = LogFactory.getLog(HibernateQNameDAOImpl.class);
|
||||||
|
|
||||||
private static final String QUERY_GET_NS_BY_URI = "qname.GetNamespaceByUri";
|
private static final String QUERY_GET_NS_BY_URI = "qname.GetNamespaceByUri";
|
||||||
private static final String QUERY_GET_QNAME_BY_URI_AND_LOCALNAME = "qname.GetQNameByUriAndLocalName";
|
private static final String QUERY_GET_QNAME_BY_URI_AND_LOCALNAME = "qname.GetQNameByUriAndLocalName";
|
||||||
|
|
||||||
@@ -98,6 +102,10 @@ public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameD
|
|||||||
|
|
||||||
public NamespaceEntity newNamespaceEntity(String namespaceUri)
|
public NamespaceEntity newNamespaceEntity(String namespaceUri)
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug("Persisting Namespace: " + namespaceUri);
|
||||||
|
}
|
||||||
NamespaceEntity namespace = new NamespaceEntityImpl();
|
NamespaceEntity namespace = new NamespaceEntityImpl();
|
||||||
namespace.setUri(namespaceUri);
|
namespace.setUri(namespaceUri);
|
||||||
// Persist
|
// Persist
|
||||||
@@ -186,6 +194,10 @@ public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameD
|
|||||||
|
|
||||||
public QNameEntity newQNameEntity(QName qname)
|
public QNameEntity newQNameEntity(QName qname)
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug("Persisting QName: " + qname);
|
||||||
|
}
|
||||||
final String namespaceUri = qname.getNamespaceURI();
|
final String namespaceUri = qname.getNamespaceURI();
|
||||||
final String localName = qname.getLocalName();
|
final String localName = qname.getLocalName();
|
||||||
NamespaceEntity namespace = getNamespaceEntity(namespaceUri);
|
NamespaceEntity namespace = getNamespaceEntity(namespaceUri);
|
||||||
|
@@ -59,7 +59,7 @@
|
|||||||
<version column="version" name="version" type="long" />
|
<version column="version" name="version" type="long" />
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<query name="qname.GetNamespaceByUri" flush-mode="never" cacheable="false">
|
<query name="qname.GetNamespaceByUri" cacheable="false">
|
||||||
select
|
select
|
||||||
namespace
|
namespace
|
||||||
from
|
from
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
namespace.uri = :namespaceUri
|
namespace.uri = :namespaceUri
|
||||||
</query>
|
</query>
|
||||||
|
|
||||||
<query name="qname.GetQNameByUriAndLocalName" flush-mode="never" cacheable="false">
|
<query name="qname.GetQNameByUriAndLocalName" cacheable="false">
|
||||||
select
|
select
|
||||||
qname
|
qname
|
||||||
from
|
from
|
||||||
|
Reference in New Issue
Block a user