<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://castor.org/test/ase"
   xmlns:jdo="http://www.castor.org/binding/persistence" xmlns="http://castor.org/test/ase">
   <xs:annotation>
      <xs:documentation>
			This is a test XML Schema with appinfo annotations for
			Entity testcase.
		</xs:documentation>
   </xs:annotation>
   <xs:element name="book" type="bookType" />

	<!--  Description of a bookType -->
   <xs:complexType name="bookType">
      <xs:annotation>
         <xs:appinfo>
				<jdo:table name="book">
					<jdo:primaryKey>
						<jdo:key>isbn</jdo:key>
					</jdo:primaryKey>
				</jdo:table>
			</xs:appinfo>
      </xs:annotation>
      <xs:sequence>
         <xs:element name="isbn" type="xs:string">
            <xs:annotation>
               <xs:appinfo>
						<jdo:column name="isbn" type="varchar" />
					</xs:appinfo>
            </xs:annotation>
         </xs:element>
         <xs:element name="title" type="xs:string">
            <xs:annotation>
               <xs:appinfo>
						<jdo:column name="title" type="varchar" />
					</xs:appinfo>
            </xs:annotation>
         </xs:element>
         <xs:element name="author" type="authorType">
            <xs:annotation>
               <xs:appinfo>
                    <jdo:one-to-many name="author_id" read-only="true" dirty="true"/>
                </xs:appinfo>
            </xs:annotation>
         </xs:element>
      </xs:sequence>
   </xs:complexType>
   
    <!--  Description of a bookType -->
   <xs:complexType name="authorType">
      <xs:annotation>
         <xs:appinfo>
                <jdo:table name="author">
                    <jdo:primaryKey>
                        <jdo:key>id</jdo:key>
                    </jdo:primaryKey>
                </jdo:table>
            </xs:appinfo>
      </xs:annotation>
      <xs:sequence>
         <xs:element name="id" type="xs:integer">
            <xs:annotation>
               <xs:appinfo>
                        <jdo:column name="author_id" type="integer" />
                    </xs:appinfo>
            </xs:annotation>
         </xs:element>
         <xs:element name="name" type="xs:string">
            <xs:annotation>
               <xs:appinfo>
                        <jdo:column name="name" type="varchar" />
                    </xs:appinfo>
            </xs:annotation>
         </xs:element>
      </xs:sequence>
   </xs:complexType>
</xs:schema>