mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed AR-571:
- Moved to use Set-based associations for child and node associations git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2848 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -151,11 +151,12 @@ public class ChildAssocImpl implements ChildAssoc
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ChildAssoc that = (ChildAssoc) obj;
|
ChildAssoc that = (ChildAssoc) obj;
|
||||||
return (this.getIsPrimary() == that.getIsPrimary()
|
return (
|
||||||
&& EqualsHelper.nullSafeEquals(this.getTypeQName(), that.getTypeQName())
|
EqualsHelper.nullSafeEquals(this.getTypeQName(), that.getTypeQName())
|
||||||
&& EqualsHelper.nullSafeEquals(this.getQname(), that.getQname())
|
&& EqualsHelper.nullSafeEquals(this.getQname(), that.getQname())
|
||||||
&& EqualsHelper.nullSafeEquals(this.getParent(), that.getParent())
|
&& EqualsHelper.nullSafeEquals(this.getParent(), that.getParent())
|
||||||
&& EqualsHelper.nullSafeEquals(this.getChild(), that.getChild()));
|
&& EqualsHelper.nullSafeEquals(this.getChild(), that.getChild())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
|
@@ -75,54 +75,58 @@
|
|||||||
name="aspects"
|
name="aspects"
|
||||||
table="node_aspects"
|
table="node_aspects"
|
||||||
lazy="false"
|
lazy="false"
|
||||||
|
fetch="join"
|
||||||
inverse="false"
|
inverse="false"
|
||||||
sort="unsorted"
|
sort="unsorted"
|
||||||
fetch="join"
|
|
||||||
optimistic-lock="true"
|
optimistic-lock="true"
|
||||||
cascade="delete" >
|
cascade="delete" >
|
||||||
<key column="node_id" not-null="true" />
|
<key column="node_id" not-null="true" />
|
||||||
<element column="qname" type="QName" length="200"/>
|
<element column="qname" type="QName" length="200"/>
|
||||||
</set>
|
</set>
|
||||||
<!-- inverse assoc to parent childassocs -->
|
<!-- inverse assoc to parent childassocs -->
|
||||||
<bag
|
<set
|
||||||
name="parentAssocs"
|
name="parentAssocs"
|
||||||
lazy="true"
|
|
||||||
inverse="true"
|
inverse="true"
|
||||||
|
lazy="true"
|
||||||
|
fetch="select"
|
||||||
cascade="none"
|
cascade="none"
|
||||||
optimistic-lock="true"
|
optimistic-lock="true" >
|
||||||
fetch="select" >
|
|
||||||
<key column="child_node_id" />
|
<key column="child_node_id" />
|
||||||
<one-to-many class="org.alfresco.repo.domain.hibernate.ChildAssocImpl" />
|
<one-to-many class="org.alfresco.repo.domain.hibernate.ChildAssocImpl" />
|
||||||
</bag>
|
</set>
|
||||||
<!-- inverse assoc to child childassocs -->
|
<!-- inverse assoc to child childassocs -->
|
||||||
<bag
|
<set
|
||||||
name="childAssocs"
|
name="childAssocs"
|
||||||
inverse="true"
|
inverse="true"
|
||||||
lazy="true"
|
lazy="true"
|
||||||
|
fetch="select"
|
||||||
cascade="none"
|
cascade="none"
|
||||||
optimistic-lock="true"
|
optimistic-lock="true" >
|
||||||
fetch="select" >
|
|
||||||
<key column="parent_node_id" />
|
<key column="parent_node_id" />
|
||||||
<one-to-many class="org.alfresco.repo.domain.hibernate.ChildAssocImpl" />
|
<one-to-many class="org.alfresco.repo.domain.hibernate.ChildAssocImpl" />
|
||||||
</bag>
|
</set>
|
||||||
<!-- inverse assoc to source nodeassocs -->
|
<!-- inverse assoc to source nodeassocs -->
|
||||||
<bag
|
<set
|
||||||
name="sourceNodeAssocs"
|
name="sourceNodeAssocs"
|
||||||
inverse="true"
|
inverse="true"
|
||||||
|
lazy="true"
|
||||||
|
fetch="select"
|
||||||
cascade="none"
|
cascade="none"
|
||||||
optimistic-lock="true" >
|
optimistic-lock="true" >
|
||||||
<key column="target_node_id" />
|
<key column="target_node_id" />
|
||||||
<one-to-many class="org.alfresco.repo.domain.hibernate.NodeAssocImpl" />
|
<one-to-many class="org.alfresco.repo.domain.hibernate.NodeAssocImpl" />
|
||||||
</bag>
|
</set>
|
||||||
<!-- inverse assoc to target nodeassocs -->
|
<!-- inverse assoc to target nodeassocs -->
|
||||||
<bag
|
<set
|
||||||
name="targetNodeAssocs"
|
name="targetNodeAssocs"
|
||||||
inverse="true"
|
inverse="true"
|
||||||
|
lazy="true"
|
||||||
|
fetch="select"
|
||||||
cascade="none"
|
cascade="none"
|
||||||
optimistic-lock="true" >
|
optimistic-lock="true" >
|
||||||
<key column="source_node_id" />
|
<key column="source_node_id" />
|
||||||
<one-to-many class="org.alfresco.repo.domain.hibernate.NodeAssocImpl" />
|
<one-to-many class="org.alfresco.repo.domain.hibernate.NodeAssocImpl" />
|
||||||
</bag>
|
</set>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class
|
<class
|
||||||
@@ -145,10 +149,10 @@
|
|||||||
name="node"
|
name="node"
|
||||||
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
||||||
column="node_id"
|
column="node_id"
|
||||||
unique="false"
|
lazy="false"
|
||||||
not-null="false"
|
|
||||||
fetch="join"
|
fetch="join"
|
||||||
lazy="false" />
|
unique="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" />
|
<property name="deleted" column="deleted" type="boolean" not-null="true" />
|
||||||
</class>
|
</class>
|
||||||
@@ -165,10 +169,6 @@
|
|||||||
<id name="id" column="id" type="long" >
|
<id name="id" column="id" type="long" >
|
||||||
<generator class="native" />
|
<generator class="native" />
|
||||||
</id>
|
</id>
|
||||||
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
|
||||||
<property name="qname" column="qname" type="QName" length="255" not-null="true" />
|
|
||||||
<property name="isPrimary" column="is_primary" />
|
|
||||||
<property name="index" column="assoc_index" />
|
|
||||||
<!-- forward assoc to parent node -->
|
<!-- forward assoc to parent node -->
|
||||||
<many-to-one
|
<many-to-one
|
||||||
name="parent"
|
name="parent"
|
||||||
@@ -189,6 +189,10 @@
|
|||||||
not-null="true" >
|
not-null="true" >
|
||||||
<column name="child_node_id" />
|
<column name="child_node_id" />
|
||||||
</many-to-one>
|
</many-to-one>
|
||||||
|
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
||||||
|
<property name="qname" column="qname" type="QName" length="255" not-null="true" />
|
||||||
|
<property name="isPrimary" column="is_primary" />
|
||||||
|
<property name="index" column="assoc_index" />
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class
|
<class
|
||||||
@@ -199,21 +203,27 @@
|
|||||||
<id name="id" column="id" type="long" >
|
<id name="id" column="id" type="long" >
|
||||||
<generator class="native" />
|
<generator class="native" />
|
||||||
</id>
|
</id>
|
||||||
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
<natural-id mutable="true">
|
||||||
<!-- forward assoc to source node -->
|
<!-- forward assoc to source node -->
|
||||||
<many-to-one
|
<many-to-one
|
||||||
name="source"
|
name="source"
|
||||||
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
||||||
not-null="true" >
|
lazy="false"
|
||||||
<column name="source_node_id" />
|
fetch="join"
|
||||||
</many-to-one>
|
not-null="true" >
|
||||||
<!-- forward assoc to target node -->
|
<column name="source_node_id" />
|
||||||
<many-to-one
|
</many-to-one>
|
||||||
name="target"
|
<!-- forward assoc to target node -->
|
||||||
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
<many-to-one
|
||||||
not-null="true" >
|
name="target"
|
||||||
<column name="target_node_id" />
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
||||||
</many-to-one>
|
lazy="false"
|
||||||
|
fetch="join"
|
||||||
|
not-null="true" >
|
||||||
|
<column name="target_node_id" />
|
||||||
|
</many-to-one>
|
||||||
|
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
||||||
|
</natural-id>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<query name="store.GetAllStores">
|
<query name="store.GetAllStores">
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.domain.hibernate;
|
package org.alfresco.repo.domain.hibernate;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -66,10 +65,10 @@ public class NodeImpl extends LifecycleAdapter implements Node
|
|||||||
public NodeImpl()
|
public NodeImpl()
|
||||||
{
|
{
|
||||||
aspects = new HashSet<QName>(5);
|
aspects = new HashSet<QName>(5);
|
||||||
sourceNodeAssocs = new ArrayList<NodeAssoc>(3);
|
sourceNodeAssocs = new HashSet<NodeAssoc>(5);
|
||||||
targetNodeAssocs = new ArrayList<NodeAssoc>(3);
|
targetNodeAssocs = new HashSet<NodeAssoc>(5);
|
||||||
parentAssocs = new ArrayList<ChildAssoc>(3);
|
parentAssocs = new HashSet<ChildAssoc>(5);
|
||||||
childAssocs = new ArrayList<ChildAssoc>(3);
|
childAssocs = new HashSet<ChildAssoc>(11);
|
||||||
properties = new HashMap<QName, PropertyValue>(5);
|
properties = new HashMap<QName, PropertyValue>(5);
|
||||||
|
|
||||||
ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
||||||
|
Reference in New Issue
Block a user