<objects>

  <!--++++++++++++++++++++++++++-->
  <!-- ABSTRACTION +++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="abstraction">
    <layout>
      <xml name="abstraction" nodeType="xs:element"/>
      <sql table="abstraction"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int" autoInc="true" global="true" globalName="entity_id"/>
    </property>

    <property name="entity_type" type="str">
      <sql type="char(16)" global="true" globalName="entity_type"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>
    
    <property name="last_modified" type="datetime">
      <sql type="datetime"/>
    </property>

    <property ref="true" object="action" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="tag" type="list" mapping="one-to-many"
	      index="name">
      <xml nodeType="xs:element"/>
    </property>
    
  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- ABSTRACTIONREF ++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="abstractionRef">
    <layout>
      <xml name="abstractionRef" nodeType="xs:element"/>
      <sql table="abstraction_ref"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>
    
    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(1023)"/>
    </property>

    <property name="cache" type="int">
      <xml name="cache" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="abstraction_id" type="long" foreignKey="true" 
	      object="abstraction">
      <xml name="abstractionId" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="version" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property ref="true" object="location" type="object" mapping="one-to-one">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="function" type="list"  mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many"
	      index="key">
      <xml nodeType="xs:element"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- ACTION ++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="action">
    <layout>
      <xml name="action" nodeType="xs:element"/>
      <sql table="action"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="prevId" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="prev_id" type="int"/>
    </property>

    <property name="date" type="datetime">
      <xml nodeType="xs:attribute" type="xs:dateTime"/>
      <sql type="datetime"/>
    </property>

    <property name="session" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="user" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="prune" type="int">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many"
	      index="key">
      <xml nodeType="xs:element"/>
    </property>

    <choice name="operation" type="list" mapping="one-to-many">
      <property name="add" ref="true" object="add">
	<xml nodeType="xs:element"/>
      </property>

      <property name="delete" ref="true" object="delete">
	<xml nodeType="xs:element"/>
      </property>

      <property name="change" ref="true" object="change">
	<xml nodeType="xs:element"/>
      </property>
    </choice>
    
    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" discriminator="parentType" type="long" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" type="long" object="vistrail">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" type="long" object="abstraction">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- ADD +++++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="add">
    <layout>
      <xml name="add" nodeType="xs:element"/>
      <sql table="add_tbl"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>
    
    <property name="what" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="objectId" type="long" foreignKey="true" discriminator="what">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="object_id" type="int"/>
    </property>

    <property name="parentObjId" type="long" foreignKey="true"
	      discriminator="parentObjType">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="par_obj_id" type="int"/>
    </property>

    <property name="parentObjType" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql column="par_obj_type" type="char(16)"/>
    </property>
    
    <choice name="data" type="object" discriminator="what">
      <property ref="true" object="module" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="location" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="annotation" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="function" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="connection" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="port" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="parameter" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="portSpec" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="abstractionRef" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="group" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="other" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="plugin_data" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
    </choice>

    <property name="action" type="long" ref="true" object="action" 
	      mapping="many-to-one" inverse="true">
      <sql column="action_id" type="int"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- ANNOTATION ++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="annotation">
    <layout>
      <xml name="annotation" nodeType="xs:element"/>
      <sql table="annotation"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="key" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql column="akey" type="varchar(255)"/>
    </property>

    <property name="value" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(8191)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
            mapping="many-to-one">
      <property ref="true" object="vistrail">
	<sql column="parent_id" type="int"/>
      </property>
      
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      
      <property ref="true" object="module">
	<sql column="parent_id" type="int"/>
      </property>

      <property ref="true" object="module_exec">
	<sql column="parent_id" type="int"/>
      </property>

      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>

      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>

      <property ref="true" object="action">
	<sql column="parent_id" type="int"/>
      </property>
      
      <property ref="true" object="abstractionRef">
	<sql column="parent_id" type="int"/>
      </property>

      <property ref="true" object="group">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- CHANGE ++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="change">
    <layout>
      <xml name="change" nodeType="xs:element"/>
      <sql table="change_tbl"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>
    
    <property name="what" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="oldObjId" type="long" foreignKey="true" discriminator="what">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="old_obj_id" type="int"/>
    </property>

    <property name="newObjId" type="long" foreignKey="true" discriminator="what">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="new_obj_id" type="int"/>
    </property>

    <property name="parentObjId" type="long" foreignKey="true" 
	      discriminator="parentObjType">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="par_obj_id" type="int"/>
    </property>

    <property name="parentObjType" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql column="par_obj_type" type="char(16)"/>
    </property>

    <choice name="data" type="object" discriminator="what">
      <property ref="true" object="module" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="location" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="annotation" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="function" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="connection" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="port" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="parameter" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="portSpec" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="abstractionRef" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="group" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="other" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
      <property ref="true" object="plugin_data" mapping="one-to-one">
	<xml nodeType="xs:element"/>
      </property>
    </choice>
    
    <property name="action" type="long" ref="true" object="action" 
	      mapping="many-to-one" inverse="true">
      <sql column="action_id" type="int"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- CONNECTION ++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="connection">
    <layout>
      <xml name="connection" nodeType="xs:element"/>
      <sql table="connection_tbl"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property ref="true" object="port" type="list" mapping="one-to-many"
	      index="type">
      <xml nodeType="xs:element"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>
    
  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- DELETE ++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="delete">
    <layout>
      <xml name="delete" nodeType="xs:element"/>
      <sql table="delete_tbl"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>
    
    <property name="what" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="objectId" type="long" foreignKey="true" discriminator="what">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="object_id" type="int"/>
    </property>

    <property name="parentObjId" type="long" foreignKey="true" 
	      discriminator="parentObjType">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql column="par_obj_id" type="int"/>
    </property>

    <property name="parentObjType" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql column="par_obj_type" type="char(16)"/>
    </property>

    <property name="action" type="long" ref="true" object="action" 
	      mapping="many-to-one" inverse="true">
      <sql column="action_id" type="int"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- FUNCTION ++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="function">
    <layout>
      <xml name="function" nodeType="xs:element"/>
      <sql table="function"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="pos" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property ref="true" object="parameter" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="module">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="abstractionRef">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="group">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- GROUP +++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="group" parentClass="module">
    <layout>
      <xml name="group" nodeType="xs:element"/>
      <sql table="group_tbl"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property ref="true" object="workflow" type="object" mapping="one-to-one" 
	      expand="false">
      <xml nodeType="xs:element"/>
    </property>

    <property name="cache" type="int">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="namespace" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="package" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(511)"/>
    </property>

    <property name="version" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="tag" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property ref="true" object="location" type="object" mapping="one-to-one">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="function" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many"
	      index="key">
      <xml nodeType="xs:element"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- LOCATION ++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="location">
    <layout>
      <xml name="location" nodeType="xs:element"/>
      <sql table="location"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="x" type="float">
      <xml nodeType="xs:attribute" type="xs:float"/>
      <sql type="DECIMAL(18,12)"/>
    </property>

    <property name="y" type="float">
      <xml nodeType="xs:attribute" type="xs:float"/>
      <sql type="DECIMAL(18,12)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="module">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="abstractionRef">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="group">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- LOG +++++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->
  
  <object name="log">
    <layout>
      <xml name="log" nodeType="xs:element"/>
      <sql table="log_tbl"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int" autoInc="true" global="true" globalName="entity_id"/>
    </property>

    <property name="entity_type" type="str">
      <sql type="char(16)" global="true" globalName="entity_type"/>
    </property>

    <property name="version" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="char(16)"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="last_modified" type="datetime">
      <sql type="datetime"/>
    </property>

    <property ref="true" object="workflow_exec" cascade="false" type="list" 
	      mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="machine" cascade="false" type="list" 
	      mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property name="vistrail_id" type="long" foreignKey="true" object="vistrail">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- MACHINE +++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="machine">
    <layout>
      <xml name="machine" nodeType="xs:element"/>
      <sql table="machine"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="os" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>
    
    <property name="architecture" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>
    
    <property name="processor" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="ram" type="int">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="vistrailId" type="long" inverse="true"
	      foreignKey="true" object="vistrail">
      <sql column="vt_id" type="int"/>
    </property>

    <property ref="true" object="log" type="long" mapping="many-to-one" 
	      inverse="true">
      <sql column="log_id" type="int"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- MODULE ++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="module">
    <layout>
      <xml name="module" nodeType="xs:element"/>
      <sql table="module"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="cache" type="int">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="namespace" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="package" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(511)"/>
    </property>

    <property name="version" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="tag" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property ref="true" object="location" type="object" mapping="one-to-one">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="function" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many"
	      index="key">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="portSpec" type="list" mapping="one-to-many"
	      index="name:type">
      <xml nodeType="xs:element"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- MODULE_EXEC +++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="module_exec">
    <layout>
      <xml name="moduleExec" nodeType="xs:element"/>
      <sql table="module_exec"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="ts_start" type="datetime">
      <xml name="tsStart" nodeType="xs:attribute" type="xs:dateTime"/>
      <sql type="datetime"/>
    </property>

    <property name="ts_end" type="datetime">
      <xml name="tsEnd" nodeType="xs:attribute" type="xs:dateTime"/>
      <sql type="datetime"/>
    </property>

    <property name="cached" type="int">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql nodeType="int"/>
    </property>

    <property name="module_id" type="long" foreignKey="true" object="module">
      <xml name="moduleId" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="module_name" type="str">
      <xml name="moduleName" nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="completed" type="int">
      <xml name="completed" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="error" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(1023)"/>
    </property>

    <property name="abstraction_id" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="abstraction_version" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="machine_id" type="long" foreignKey="true" object="machine">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="workflow_exec" type="long" mapping="many-to-one" 
	      inverse="true">
      <sql column="wf_exec_id" type="int"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- OTHER +++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="other">
    <layout>
      <xml name="other" nodeType="xs:element"/>
      <sql table="other"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="key" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql column="okey" type="varchar(255)"/>
    </property>

    <property name="value" type="str">
      <xml nodeType="xs:element" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- PARAMETER +++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="parameter">
    <layout>
      <xml name="parameter" nodeType="xs:element"/>
      <sql table="parameter"/>
    </layout>
    
    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="pos" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="type" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="val" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(8191)"/>
    </property>

    <property name="alias" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="function">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- PLUGIN DATA +++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="plugin_data">
    <layout>
      <xml name="plugin_data" nodeType="xs:element"/>
      <sql table="plugin_data"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="data" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(8191)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="workflow">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>
  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- PORT ++++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="port">
    <layout>
      <xml name="port" nodeType="xs:element"/>
      <sql table="port"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="type" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="moduleId" type="long" foreignKey="true" object="module">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="moduleName" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="spec" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(4095)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="connection" type="long" mapping="many-to-one" 
		inverse="true">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- PORTSPEC ++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="portSpec">
    <layout>
      <xml name="portSpec" nodeType="xs:element"/>
      <sql table="port_spec"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(22)"/>
    </property>

    <property name="type" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="spec" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" type="long" discriminator="parentType" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" object="module">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="add">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" object="change">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- TAG +++++++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="tag">
    <layout>
      <xml name="tag" nodeType="xs:element"/>
      <sql table="tag"/>
    </layout>

    <property name="id" type="long" primaryKey="true" foreignKey="true" 
	      object="action">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>

    <choice name="parent" discriminator="parentType" type="long" inverse="true" 
	    mapping="many-to-one">
      <property ref="true" type="long" object="vistrail">
	<sql column="parent_id" type="int"/>
      </property>
      <property ref="true" type="long" object="abstraction">
	<sql column="parent_id" type="int"/>
      </property>
    </choice>
    
    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- VISTRAIL ++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="vistrail">
    <layout>
      <xml name="vistrail" nodeType="xs:element"/>
      <sql table="vistrail"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int" autoInc="true" global="true" globalName="entity_id"/>
    </property>
    
    <property name="entity_type" type="str">
      <sql type="char(16)" global="true" globalName="entity_type"/>
    </property>

    <property name="version" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="char(16)"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="last_modified" type="datetime">
      <sql type="datetime"/>
    </property>

    <property ref="true" object="action" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="tag" type="list" mapping="one-to-many"
	      index="name">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many"
	      index="key">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="abstraction" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>
  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- WORKFLOW ++++++++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="workflow">
    <layout>
      <xml name="workflow" nodeType="xs:element"/>
      <sql table="workflow"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int" autoInc="true" global="true" globalName="entity_id"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str">
      <sql type="char(16)" global="true" globalName="entity_type"/>
    </property>

    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>
    
    <property name="version" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="char(16)"/>
    </property>

    <property name="last_modified" type="datetime">
      <sql type="datetime"/>
    </property>

    <choice name="module" type="list" mapping="one-to-many">
      <property name="module" ref="true" object="module">
	<xml nodeType="xs:element"/>
      </property>

      <property name="abstractionRef" ref="true" object="abstractionRef">
	<xml nodeType="xs:element"/>
      </property>

      <property name="group" ref="true" object="group">
	<xml nodeType="xs:element"/>
      </property>
    </choice>
    
    <property ref="true" object="connection" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="annotation" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <!-- only need for copy/paste so no sql bindings -->
    <property ref="true" object="abstraction" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="plugin_data" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property ref="true" object="other" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property name="vistrail_id" type="long" foreignKey="true" object="vistrail">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="parent" ref="true" object="group" type="long" inverse="true">
      <sql column="parent_id" type="int"/>
    </property>
    
    <property name="parentType" type="str" inverse="true">
      <sql column="parent_type" type="char(16)"/>
    </property>
  </object>

  <!--++++++++++++++++++++++++++-->
  <!-- WORKFLOW_EXEC +++++++++++-->
  <!--++++++++++++++++++++++++++-->

  <object name="workflow_exec">
    <layout>
      <xml name="workflowExec" nodeType="xs:element"/>
      <sql table="workflow_exec"/>
    </layout>

    <property name="id" type="long" primaryKey="true">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="user" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="ip" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="session" type="long">
      <xml nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="vt_version" type="str">
      <xml name="vtVersion" nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="ts_start" type="datetime">
      <xml name="tsStart" nodeType="xs:attribute" type="xs:dateTime"/>
      <sql type="datetime"/>
    </property>

    <property name="ts_end" type="datetime">
      <xml name="tsEnd" nodeType="xs:attribute" type="xs:dateTime"/>
      <sql type="datetime"/>
    </property>

    <property name="parent_id" type="long">
      <xml name="parentId" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="parent_type" type="str">
      <xml name="parentType" nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property name="parent_version" type="long">
      <xml name="parentVersion" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>

    <property name="completed" type="int">
      <xml name="completed" nodeType="xs:attribute" type="xs:int"/>
      <sql type="int"/>
    </property>
    
    <property name="name" type="str">
      <xml nodeType="xs:attribute" type="xs:string"/>
      <sql type="varchar(255)"/>
    </property>

    <property ref="true" object="log" type="long" mapping="many-to-one" 
	      inverse="true">
      <sql column="log_id" type="int"/>
    </property>

    <property ref="true" object="module_exec" type="list" mapping="one-to-many">
      <xml nodeType="xs:element"/>
    </property>

    <property name="entity_id" type="long" inverse="true">
      <sql type="int"/>
    </property>

    <property name="entity_type" type="str" inverse="true">
      <sql type="char(16)"/>
    </property>

  </object>
</objects>
