mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
Benchmark client Note: - Loading types still need to be fleshed out - The content over RMI is weak, but sufficient for this use-case. - An all-round solution for RMI content serialization is needed for ContentReader and ContentWriter, probably using the RemotableInputStream, etc git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
513 lines
17 KiB
XML
513 lines
17 KiB
XML
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
<!DOCTYPE hibernate-mapping PUBLIC
|
|
'-//Hibernate/Hibernate Mapping DTD 3.0//EN'
|
|
'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>
|
|
|
|
<hibernate-mapping>
|
|
|
|
<typedef class="org.alfresco.repo.domain.hibernate.QNameUserType" name="QName" />
|
|
<typedef class="org.alfresco.repo.domain.hibernate.LocaleUserType" name="Locale" />
|
|
|
|
<class
|
|
name="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
proxy="org.alfresco.repo.domain.Node"
|
|
table="alf_node"
|
|
dynamic-update="false"
|
|
dynamic-insert="false"
|
|
select-before-update="false"
|
|
lazy="true"
|
|
optimistic-lock="version" >
|
|
<!-- auto-generated ID -->
|
|
<id name="id" column="id" type="long" >
|
|
<generator class="native" />
|
|
</id>
|
|
<!-- the natural ID of the node -->
|
|
<natural-id mutable="true">
|
|
<!-- forward assoc to store -->
|
|
<many-to-one
|
|
name="store"
|
|
class="org.alfresco.repo.domain.hibernate.StoreImpl"
|
|
not-null="true"
|
|
lazy="proxy"
|
|
optimistic-lock="true"
|
|
fetch="join">
|
|
<column name="protocol" not-null="true" />
|
|
<column name="identifier" not-null="true" />
|
|
</many-to-one>
|
|
<!-- the store-unique identifier -->
|
|
<property name="uuid" column="uuid" type="string" length="36" />
|
|
</natural-id>
|
|
<!-- Optimistic locking -->
|
|
<version column="version" name="version" type="long" />
|
|
|
|
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
|
<!-- forward assoc to access control list (optional) -->
|
|
<many-to-one
|
|
name="accessControlList"
|
|
class="org.alfresco.repo.domain.hibernate.DbAccessControlListImpl"
|
|
column="acl_id"
|
|
lazy="proxy"
|
|
fetch="select"
|
|
unique="false"
|
|
not-null="false"
|
|
cascade="delete" />
|
|
<!-- forward assoc to properties -->
|
|
<map
|
|
name="properties"
|
|
table="alf_node_properties"
|
|
lazy="true"
|
|
fetch="select"
|
|
sort="unsorted"
|
|
inverse="false"
|
|
optimistic-lock="true"
|
|
cascade="delete" >
|
|
<key column="node_id" not-null="true" />
|
|
<map-key column="qname" type="QName" length="200" />
|
|
<composite-element class="org.alfresco.repo.domain.PropertyValue" >
|
|
<property name="actualType" column="actual_type" type="string" length="15" not-null="true" />
|
|
<property name="multiValued" column="multi_valued" type="boolean" not-null="true" />
|
|
<property name="persistedType" column="persisted_type" type="string" length="15" not-null="true" />
|
|
<property name="booleanValue" column="boolean_value" type="boolean" />
|
|
<property name="longValue" column="long_value" type="long" />
|
|
<property name="floatValue" column="float_value" type="float" />
|
|
<property name="doubleValue" column="double_value" type="double" />
|
|
<property name="stringValue" column="string_value" type="string" length="1024"/>
|
|
<many-to-one name="attributeValue" column="attribute_value" class="org.alfresco.repo.attributes.AttributeImpl" />
|
|
<property name="serializableValue" column="serializable_value" type="serializable" length="16384"/>
|
|
</composite-element>
|
|
</map>
|
|
<!-- forward assoc to aspects -->
|
|
<set
|
|
name="aspects"
|
|
table="alf_node_aspects"
|
|
lazy="false"
|
|
fetch="join"
|
|
inverse="false"
|
|
sort="unsorted"
|
|
optimistic-lock="true"
|
|
cascade="delete" >
|
|
<key column="node_id" not-null="true" />
|
|
<element column="qname" type="QName" length="200"/>
|
|
</set>
|
|
<!-- inverse assoc to parent childassocs -->
|
|
<!--
|
|
<set
|
|
name="parentAssocs"
|
|
inverse="true"
|
|
lazy="false"
|
|
fetch="join"
|
|
cascade="none"
|
|
optimistic-lock="true" >
|
|
<key column="child_node_id" />
|
|
<one-to-many class="org.alfresco.repo.domain.hibernate.ChildAssocImpl" />
|
|
</set>
|
|
-->
|
|
</class>
|
|
|
|
<class
|
|
name="org.alfresco.repo.domain.hibernate.NodeStatusImpl"
|
|
proxy="org.alfresco.repo.domain.NodeStatus"
|
|
table="alf_node_status"
|
|
dynamic-update="false"
|
|
dynamic-insert="false"
|
|
select-before-update="false"
|
|
lazy="true"
|
|
optimistic-lock="version" >
|
|
<!-- composite PK -->
|
|
<composite-id name="key" class="org.alfresco.repo.domain.NodeKey">
|
|
<key-property name="protocol" length="50" />
|
|
<key-property name="identifier" length="100" />
|
|
<key-property name="guid" length="36" />
|
|
</composite-id>
|
|
<!-- Optimistic locking -->
|
|
<version column="version" name="version" type="long" />
|
|
<!-- forward assoc to transaction -->
|
|
<many-to-one
|
|
name="transaction"
|
|
class="org.alfresco.repo.domain.hibernate.TransactionImpl"
|
|
column="transaction_id"
|
|
lazy="proxy"
|
|
fetch="select"
|
|
unique="false"
|
|
not-null="true"
|
|
cascade="none" />
|
|
<!-- forward assoc to node (optional) -->
|
|
<many-to-one
|
|
name="node"
|
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
column="node_id"
|
|
lazy="false"
|
|
fetch="join"
|
|
unique="false"
|
|
not-null="false" />
|
|
</class>
|
|
|
|
<class
|
|
name="org.alfresco.repo.domain.hibernate.ChildAssocImpl"
|
|
proxy="org.alfresco.repo.domain.ChildAssoc"
|
|
dynamic-insert="false"
|
|
dynamic-update="false"
|
|
lazy="true"
|
|
optimistic-lock="version"
|
|
table="alf_child_assoc" >
|
|
<!-- auto-generated ID -->
|
|
<id name="id" column="id" type="long" >
|
|
<generator class="native" />
|
|
</id>
|
|
<!-- Optimistic locking -->
|
|
<version column="version" name="version" type="long" />
|
|
<!-- forward assoc to parent node -->
|
|
<many-to-one
|
|
name="parent"
|
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
lazy="proxy"
|
|
fetch="select"
|
|
optimistic-lock="false"
|
|
not-null="true"
|
|
unique-key="UIDX_CHILD_NAME" >
|
|
<column name="parent_node_id" not-null="true" />
|
|
</many-to-one>
|
|
<!-- forward assoc to child node -->
|
|
<many-to-one
|
|
name="child"
|
|
lazy="proxy"
|
|
fetch="select"
|
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
optimistic-lock="false"
|
|
not-null="true" >
|
|
<column name="child_node_id" not-null="true"/>
|
|
</many-to-one>
|
|
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" unique-key="UIDX_CHILD_NAME" />
|
|
<property name="qname" column="qname" type="QName" length="255" not-null="true" />
|
|
<property name="childNodeName" column="child_node_name" type="string" length="50" not-null="true" unique-key="UIDX_CHILD_NAME" />
|
|
<property name="childNodeNameCrc" column="child_node_name_crc" type="long" not-null="true" unique-key="UIDX_CHILD_NAME" />
|
|
<property name="isPrimary" column="is_primary" />
|
|
<property name="index" column="assoc_index" />
|
|
</class>
|
|
|
|
<class
|
|
name="org.alfresco.repo.domain.hibernate.NodeAssocImpl"
|
|
proxy="org.alfresco.repo.domain.NodeAssoc"
|
|
table="alf_node_assoc" >
|
|
<!-- auto-generated ID -->
|
|
<id name="id" column="id" type="long" >
|
|
<generator class="native" />
|
|
</id>
|
|
<natural-id mutable="true">
|
|
<!-- forward assoc to source node -->
|
|
<many-to-one
|
|
name="source"
|
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
optimistic-lock="false"
|
|
lazy="false"
|
|
fetch="join"
|
|
not-null="true" >
|
|
<column name="source_node_id" not-null="true" />
|
|
</many-to-one>
|
|
<!-- forward assoc to target node -->
|
|
<many-to-one
|
|
name="target"
|
|
class="org.alfresco.repo.domain.hibernate.NodeImpl"
|
|
optimistic-lock="false"
|
|
lazy="false"
|
|
fetch="join"
|
|
not-null="true" >
|
|
<column name="target_node_id" not-null="true" />
|
|
</many-to-one>
|
|
<property name="typeQName" column="type_qname" type="QName" length="255" not-null="true" />
|
|
</natural-id>
|
|
<!-- Optimistic locking -->
|
|
<version column="version" name="version" type="long" />
|
|
</class>
|
|
|
|
<query name="store.GetAllStores">
|
|
select
|
|
store
|
|
from
|
|
org.alfresco.repo.domain.hibernate.StoreImpl as store
|
|
</query>
|
|
|
|
<query name="node.updateChildAssocName">
|
|
update
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl assoc
|
|
set
|
|
assoc.childNodeName = :newName,
|
|
assoc.childNodeNameCrc = :newNameCrc
|
|
where
|
|
assoc.id = :childAssocId
|
|
</query>
|
|
|
|
<query name="node.GetParentAssocs">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.child.id = :childId
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetPrimaryChildNodeStatuses">
|
|
select
|
|
status
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeStatusImpl as status
|
|
join status.node as node
|
|
where
|
|
node.id in
|
|
(
|
|
select
|
|
child.id
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
join assoc.child as child
|
|
where
|
|
assoc.parent.id = :parentId and
|
|
assoc.isPrimary = true
|
|
)
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocsByAll">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.parent.id = :parentId and
|
|
assoc.child.id = :childId and
|
|
assoc.typeQName = :typeQName and
|
|
assoc.qname = :qname
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocs">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.parent.id = :parentId
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocIdByShortName">
|
|
select
|
|
assoc.id
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.parent.id = :parentId and
|
|
assoc.childNodeName = :childNodeName and
|
|
assoc.childNodeNameCrc = :childNodeNameCrc
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocByTypeAndName">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.parent.id = :parentId and
|
|
assoc.typeQName = :typeQName and
|
|
assoc.childNodeName = :childNodeName and
|
|
assoc.childNodeNameCrc = :childNodeNameCrc
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocRefs">
|
|
select
|
|
assoc.typeQName,
|
|
assoc.qname,
|
|
assoc.isPrimary,
|
|
assoc.index,
|
|
child.id,
|
|
child.store.key.protocol,
|
|
child.store.key.identifier,
|
|
child.uuid as parentUuid
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
join assoc.parent as parent
|
|
join assoc.child as child
|
|
where
|
|
assoc.parent.id = :parentId
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocRefsByQName">
|
|
select
|
|
assoc.typeQName,
|
|
assoc.qname,
|
|
assoc.isPrimary,
|
|
assoc.index,
|
|
child.id,
|
|
child.store.key.protocol,
|
|
child.store.key.identifier,
|
|
child.uuid as parentUuid
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
join assoc.parent as parent
|
|
join assoc.child as child
|
|
where
|
|
assoc.parent.id = :parentId and
|
|
assoc.qname = :childAssocQName
|
|
order by
|
|
assoc.index,
|
|
assoc.id
|
|
</query>
|
|
|
|
<query name="node.GetNodeAssoc">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeAssocImpl as assoc
|
|
where
|
|
assoc.source.id = :sourceId and
|
|
assoc.target.id = :targetId and
|
|
assoc.typeQName = :assocTypeQName
|
|
</query>
|
|
|
|
<query name="node.GetNodeAssocsToAndFrom">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeAssocImpl as assoc
|
|
where
|
|
assoc.source.id = :nodeId or
|
|
assoc.target.id = :nodeId
|
|
</query>
|
|
|
|
<query name="node.GetTargetAssocs">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeAssocImpl as assoc
|
|
join assoc.source as source
|
|
join assoc.target as target
|
|
where
|
|
assoc.source.id = :sourceId
|
|
</query>
|
|
|
|
<query name="node.GetSourceAssocs">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeAssocImpl as assoc
|
|
join assoc.source as source
|
|
join assoc.target as target
|
|
where
|
|
assoc.target.id = :targetId
|
|
</query>
|
|
|
|
<query name="node.GetNodesWithPropertyValuesByActualType">
|
|
select
|
|
node
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl as node
|
|
join
|
|
node.properties prop
|
|
where
|
|
(
|
|
prop.actualType = :actualTypeString or
|
|
prop.actualType = 'SERIALIZABLE'
|
|
) and
|
|
prop.persistedType != 'NULL'
|
|
</query>
|
|
|
|
<query name="node.patch.GetNodesWithPersistedSerializableProperties">
|
|
select distinct
|
|
node
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl as node
|
|
where
|
|
node.properties.serializableValue is not null and
|
|
node.properties.multiValued = false
|
|
</query>
|
|
|
|
<query name="node.patch.GetAssocsAndChildNames">
|
|
<![CDATA[
|
|
select
|
|
assoc,
|
|
child
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
join assoc.child as child
|
|
where
|
|
assoc.id > :lastAssocId and
|
|
assoc.typeQName = :assocTypeQName
|
|
order by
|
|
assoc.id
|
|
]]>
|
|
</query>
|
|
|
|
<query name="node.GetNodeStatusesForStore">
|
|
select
|
|
status
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeStatusImpl as status
|
|
where
|
|
status.key.protocol = :protocol and
|
|
status.key.identifier = :identifier
|
|
</query>
|
|
|
|
<query name="node.GetChildAssocsForStore">
|
|
select
|
|
assoc
|
|
from
|
|
org.alfresco.repo.domain.hibernate.ChildAssocImpl as assoc
|
|
where
|
|
assoc.parent.id in (select
|
|
node.id
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl node
|
|
where
|
|
node.store.key.protocol = :protocol and
|
|
node.store.key.identifier = :identifier)
|
|
</query>
|
|
|
|
<query name="node.GetNodesExceptRootForStore">
|
|
select
|
|
node
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl as node
|
|
where
|
|
node.store.key.protocol = :nodeProtocol and
|
|
node.store.key.identifier = :nodeIdentifier and
|
|
node.id != (select
|
|
rootNode.id
|
|
from
|
|
org.alfresco.repo.domain.hibernate.StoreImpl store
|
|
where
|
|
store.key.protocol = :storeProtocol and
|
|
store.key.identifier = :storeIdentifier)
|
|
</query>
|
|
|
|
<query name="node.GetNodeCount">
|
|
select
|
|
count(node.id)
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl as node
|
|
</query>
|
|
|
|
<query name="node.GetNodeCountForStore">
|
|
select
|
|
count(node.id)
|
|
from
|
|
org.alfresco.repo.domain.hibernate.NodeImpl as node
|
|
where
|
|
node.store.key.protocol = :protocol and
|
|
node.store.key.identifier = :identifier
|
|
</query>
|
|
|
|
</hibernate-mapping>
|