<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 for no sql bindings -->
  <property ref="true" object="abstraction" 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>
  
