<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="vistrailId" type="long" inverse="true"
	    foreignKey="true" object="vistrail">
    <sql column="vt_id" type="int"/>
  </property>

</object>
