<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://doctrine-project.org/schemas/orm/doctrine-mapping"
    xmlns:orm="http://doctrine-project.org/schemas/orm/doctrine-mapping"
    elementFormDefault="qualified">

  <xs:annotation>
    <xs:documentation><![CDATA[
       This is the XML Schema for the object/relational
       mapping file used by the Doctrine ORM.
     ]]></xs:documentation>
  </xs:annotation>

  <xs:element name="doctrine-mapping">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="mapped-superclass" type="orm:mapped-superclass" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="entity" type="orm:entity" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="embeddable" type="orm:embeddable" minOccurs="0" maxOccurs="unbounded" />
        <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
      </xs:choice>
      <xs:anyAttribute namespace="##other"/>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="emptyType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="cascade-type">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="cascade-all" type="orm:emptyType" minOccurs="0"/>
      <xs:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
      <xs:element name="cascade-remove" type="orm:emptyType" minOccurs="0"/>
      <xs:element name="cascade-refresh" type="orm:emptyType" minOccurs="0"/>
      <xs:element name="cascade-detach" type="orm:emptyType" minOccurs="0"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:simpleType name="lifecycle-callback-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="prePersist"/>
      <xs:enumeration value="postPersist"/>
      <xs:enumeration value="preUpdate"/>
      <xs:enumeration value="postUpdate"/>
      <xs:enumeration value="preRemove"/>
      <xs:enumeration value="postRemove"/>
      <xs:enumeration value="postLoad"/>
      <xs:enumeration value="preFlush"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="cache-usage-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="READ_ONLY"/>
      <xs:enumeration value="READ_WRITE"/>
      <xs:enumeration value="NONSTRICT_READ_WRITE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="lifecycle-callback">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="type" type="orm:lifecycle-callback-type" use="required" />
    <xs:attribute name="method" type="xs:NMTOKEN" use="required" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="lifecycle-callbacks">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="lifecycle-callback" type="orm:lifecycle-callback" minOccurs="1" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="entity-listener">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="lifecycle-callback" type="orm:lifecycle-callback" minOccurs="0" maxOccurs="unbounded"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="class" type="orm:fqcn"/>
  </xs:complexType>

  <xs:complexType name="entity-listeners">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="entity-listener" type="orm:entity-listener" minOccurs="1" maxOccurs="unbounded" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="column-result">
    <xs:attribute name="name" type="xs:string" use="required" />
  </xs:complexType>

  <xs:complexType name="field-result">
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:attribute name="column" type="xs:string" />
  </xs:complexType>

  <xs:complexType name="entity-result">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="field-result" type="orm:field-result" minOccurs="0" maxOccurs="unbounded" />
    </xs:choice>
    <xs:attribute name="entity-class" type="orm:fqcn" use="required" />
    <xs:attribute name="discriminator-column" type="xs:string" use="optional" />
  </xs:complexType>

  <xs:complexType name="cache">
    <xs:attribute name="usage" type="orm:cache-usage-type" />
    <xs:attribute name="region" type="xs:string" />
  </xs:complexType>

  <xs:complexType name="entity">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="cache" type="orm:cache" minOccurs="0" maxOccurs="1"/>
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:element name="indexes" type="orm:indexes" minOccurs="0"/>
      <xs:element name="unique-constraints" type="orm:unique-constraints" minOccurs="0"/>
      <xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
      <xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
      <xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
      <xs:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0" maxOccurs="1" />
      <xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="embedded" type="orm:embedded" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="association-overrides" type="orm:association-overrides" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="attribute-overrides" type="orm:attribute-overrides" minOccurs="0" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:attribute name="table" type="orm:tablename" />
    <xs:attribute name="schema" type="xs:NMTOKEN" />
    <xs:attribute name="repository-class" type="orm:fqcn"/>
    <xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
    <xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
    <xs:attribute name="read-only" type="xs:boolean" default="false" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:simpleType name="tablename" id="tablename">
    <xs:restriction base="xs:token">
      <xs:pattern value="[a-zA-Z_u01-uff.]+" id="tablename.pattern">
      </xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="option" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="option" type="orm:option"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="options">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="option" type="orm:option" minOccurs="0" maxOccurs="unbounded"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="mapped-superclass" >
    <xs:complexContent>
      <xs:extension base="orm:entity"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="embeddable">
    <xs:complexContent>
      <xs:extension base="orm:entity"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="change-tracking-policy">
    <xs:restriction base="xs:token">
      <xs:enumeration value="DEFERRED_IMPLICIT"/>
      <xs:enumeration value="DEFERRED_EXPLICIT"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="inheritance-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="SINGLE_TABLE"/>
      <xs:enumeration value="JOINED"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="generator-strategy">
    <xs:restriction base="xs:token">
      <xs:enumeration value="NONE"/>
      <xs:enumeration value="SEQUENCE"/>
      <xs:enumeration value="IDENTITY"/>
      <xs:enumeration value="AUTO"/>
      <xs:enumeration value="CUSTOM" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="fk-action">
    <xs:restriction base="xs:token">
      <xs:enumeration value="CASCADE"/>
      <xs:enumeration value="RESTRICT"/>
      <xs:enumeration value="SET NULL"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="fetch-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="EAGER"/>
      <xs:enumeration value="LAZY"/>
      <xs:enumeration value="EXTRA_LAZY"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="generated-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="NEVER"/>
      <xs:enumeration value="INSERT"/>
      <xs:enumeration value="ALWAYS"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="field">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="type" type="orm:type" default="string" />
    <xs:attribute name="column" type="orm:columntoken" />
    <xs:attribute name="length" type="xs:NMTOKEN" />
    <xs:attribute name="unique" type="xs:boolean" default="false" />
    <xs:attribute name="nullable" type="xs:boolean" default="false" />
    <xs:attribute name="index" type="xs:boolean" default="false" />
    <xs:attribute name="insertable" type="xs:boolean" default="true" />
    <xs:attribute name="updatable" type="xs:boolean" default="true" />
    <xs:attribute name="generated" type="orm:generated-type" default="NEVER" />
    <xs:attribute name="enum-type" type="xs:string" />
    <xs:attribute name="version" type="xs:boolean" />
    <xs:attribute name="column-definition" type="xs:string" />
    <xs:attribute name="precision" type="xs:integer" use="optional" />
    <xs:attribute name="scale" type="xs:integer" use="optional" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="embedded">
    <xs:sequence>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:attribute name="class" type="orm:fqcn" use="optional" />
    <xs:attribute name="column-prefix" type="xs:string" use="optional" />
    <xs:attribute name="use-column-prefix" type="xs:boolean" default="true" use="optional" />
  </xs:complexType>

  <xs:complexType name="discriminator-column">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="type" type="xs:NMTOKEN"/>
    <xs:attribute name="field-name" type="xs:NMTOKEN" />
    <xs:attribute name="length" type="xs:NMTOKEN" />
    <xs:attribute name="column-definition" type="xs:string" />
    <xs:attribute name="enum-type" type="xs:string" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="unique-constraint">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
    <xs:attribute name="columns" type="xs:string" use="optional"/>
    <xs:attribute name="fields" type="xs:string" use="optional"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="unique-constraints">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="unique-constraint" type="orm:unique-constraint" minOccurs="1" maxOccurs="unbounded"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="index">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
    <xs:attribute name="columns" type="xs:string" use="optional"/>
    <xs:attribute name="fields" type="xs:string" use="optional"/>
    <xs:attribute name="flags" type="xs:string" use="optional"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="indexes">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="index" type="orm:index" minOccurs="1" maxOccurs="unbounded"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="discriminator-mapping">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="value" type="orm:type" use="required"/>
    <xs:attribute name="class" type="orm:fqcn" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="discriminator-map">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="discriminator-mapping" type="orm:discriminator-mapping" minOccurs="1" maxOccurs="unbounded"/>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="generator">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="strategy" type="orm:generator-strategy" use="optional" default="AUTO" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="id">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="generator" type="orm:generator" minOccurs="0" />
      <xs:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="1" />
      <xs:element name="custom-id-generator" type="orm:custom-id-generator" minOccurs="0" maxOccurs="1" />
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="type" type="orm:type" />
    <xs:attribute name="column" type="orm:columntoken" />
    <xs:attribute name="length" type="xs:NMTOKEN" />
    <xs:attribute name="association-key" type="xs:boolean" default="false" />
    <xs:attribute name="column-definition" type="xs:string" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="sequence-generator">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
      <xs:attribute name="sequence-name" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="allocation-size" type="xs:integer" use="optional" default="1" />
      <xs:attribute name="initial-value" type="xs:integer" use="optional" default="1" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="custom-id-generator">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="class" type="orm:fqcn" use="required" />
  </xs:complexType>

  <xs:simpleType name="fqcn" id="fqcn">
    <xs:restriction base="xs:token">
      <xs:pattern value="[a-zA-Z_u01-uff][a-zA-Z0-9_u01-uff]+" id="fqcn.pattern">
      </xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="type" id="type">
    <xs:restriction base="xs:token">
      <xs:pattern value="([a-zA-Z_u01-uff][a-zA-Z0-9_u01-uff]+)|(\c+)" id="type.class.pattern">
      </xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="inverse-join-columns">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="join-column">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="optional" />
    <xs:attribute name="referenced-column-name" type="xs:NMTOKEN" use="optional" default="id" />
    <xs:attribute name="unique" type="xs:boolean" default="false" />
    <xs:attribute name="nullable" type="xs:boolean" default="true" />
    <xs:attribute name="on-delete" type="orm:fk-action" />
    <xs:attribute name="column-definition" type="xs:string" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="join-columns">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="join-table">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="join-columns" type="orm:join-columns" />
      <xs:element name="inverse-join-columns" type="orm:join-columns" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="schema" type="xs:NMTOKEN" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="order-by">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="order-by-field" type="orm:order-by-field" minOccurs="1" maxOccurs="unbounded" />
          <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
      </xs:choice>
      <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="order-by-field">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="direction" type="orm:order-by-direction" default="ASC" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:simpleType name="order-by-direction">
    <xs:restriction base="xs:token">
      <xs:enumeration value="ASC"/>
      <xs:enumeration value="DESC"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="columntoken" id="columntoken">
    <xs:restriction base="xs:token">
      <xs:pattern value="[-._:A-Za-z0-9`]+" id="columntoken.pattern"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="many-to-many">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="cache" type="orm:cache" minOccurs="0" maxOccurs="1"/>
      <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
      <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
      <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="target-entity" type="xs:string" use="required" />
    <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
    <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
    <xs:attribute name="index-by" type="xs:NMTOKEN" />
    <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
    <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="one-to-many">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="cache" type="orm:cache" minOccurs="0" maxOccurs="1"/>
      <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
      <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="target-entity" type="xs:string" use="required" />
    <xs:attribute name="mapped-by" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="index-by" type="xs:NMTOKEN" />
    <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
    <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="many-to-one">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="cache" type="orm:cache" minOccurs="0" maxOccurs="1"/>
      <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
      <xs:choice minOccurs="0" maxOccurs="1">
        <xs:element name="join-column" type="orm:join-column"/>
        <xs:element name="join-columns" type="orm:join-columns"/>
      </xs:choice>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="target-entity" type="xs:string" />
    <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
    <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="one-to-one">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="cache" type="orm:cache" minOccurs="0" maxOccurs="1"/>
      <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
      <xs:choice minOccurs="0" maxOccurs="1">
        <xs:element name="join-column" type="orm:join-column"/>
        <xs:element name="join-columns" type="orm:join-columns"/>
      </xs:choice>
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="target-entity" type="xs:string" />
    <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
    <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
    <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
    <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

  <xs:complexType name="association-overrides">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="association-override" type="orm:association-override" minOccurs="1" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="association-override">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
      <xs:element name="join-columns" type="orm:join-columns" minOccurs="0" />
      <xs:element name="inversed-by" type="orm:inversed-by-override" minOccurs="0" maxOccurs="1" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="fetch" type="orm:fetch-type" use="optional" />
  </xs:complexType>

  <xs:complexType name="inversed-by-override">
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  </xs:complexType>

  <xs:complexType name="attribute-overrides">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="attribute-override" type="orm:attribute-override" minOccurs="1" maxOccurs="unbounded" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="attribute-override">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="field" type="orm:attribute-override-field" minOccurs="1" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  </xs:complexType>

  <xs:complexType name="attribute-override-field">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="options" type="orm:options" minOccurs="0" />
      <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
    </xs:choice>
    <xs:attribute name="type" type="orm:type" default="string" />
    <xs:attribute name="column" type="orm:columntoken" />
    <xs:attribute name="length" type="xs:NMTOKEN" />
    <xs:attribute name="unique" type="xs:boolean" default="false" />
    <xs:attribute name="nullable" type="xs:boolean" default="false" />
    <xs:attribute name="insertable" type="xs:boolean" default="true" />
    <xs:attribute name="updateable" type="xs:boolean" default="true" />
    <xs:attribute name="version" type="xs:boolean" />
    <xs:attribute name="column-definition" type="xs:string" />
    <xs:attribute name="precision" type="xs:integer" use="optional" />
    <xs:attribute name="scale" type="xs:integer" use="optional" />
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>

</xs:schema>
