<?xml version="1.0" encoding="UTF-8"?>
<!-- DomainObjects for .NET                                                                 -->
<!-- Copyright ©  2003-2008 Richard Beauchamp  <rbeauchamp@gmail.com>                       -->
<!-- This file defines the .NET persistable object-to-relational TableName mappings         -->
<!--                                                                                        -->
<!-- IsolationLevel   - the database transaction isolation level.                           -->
<!-- DefaultAssembly  - the assembly, by default, that contains the persistable             -->
<!--                    objects defined in this mapping.                                    -->
<!-- Note that DomainObjects uses a validating reader when parsing the Repository.xml file. -->
<DescriptorRepository IsolationLevel="ReadCommitted" DefaultAssembly="helloworld" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..\..\..\..\resource\Repository.xsd">
	<!-- For each persistable object type, define one 'ClassDescriptor' mapping.        -->
	<!-- This mapping tells DomainObjects which persistable object fields map to which  -->
	<!-- relational table columns.                                                      -->
	<!--                                                                                -->
	<!-- ClassName  - The namespace-qualified name of the persistable object type.      -->
	<!-- TableName - The name of the database table to which this persistable           -->
	<!--             object is mapped.                                                  -->
	<!--                                                                                -->
	<!-- Mapping for the Tutorial.Star persistable object                               -->
	<!--                                                                                -->
  <ClassDescriptor ClassName="DomainObjects.Tutorial.Star" TableName="STAR">
    <!-- Every ClassDescriptor must define one primary key descriptor.                -->
    <!-- IsComputed - a flag to indicate that the value for the primary key is        -->
    <!--              automatically generated by the database via an identity column  -->
    <!--              or via a sequence number mechanism.                             -->
    <PrimaryKeyDescriptor>
      <FieldDescriptor Id="STAR1" FieldName="_primaryKey" ColumnName="STAR_ID" DbType="Int32" IsComputed="true"/>
    </PrimaryKeyDescriptor>
    <!-- Id         - a unique id for the field descriptor                          -->
    <!-- FieldName  - the name of the field in the persistable object               -->
    <!-- ColumnName - the name of the table column to which the field maps          -->
    <!-- DbType     - the database type of the TableName ColumnName                 -->
    <FieldDescriptor Id="STAR2" FieldName="_name" ColumnName="NAME" DbType="AnsiString"/>
  </ClassDescriptor>
	<!--                                                      -->
	<!-- Mapping for the Tutorial.Planet persistable object.  -->
	<!--                                                      -->
	<ClassDescriptor ClassName="DomainObjects.Tutorial.Planet" TableName="PLANET">
		<PrimaryKeyDescriptor>
			<FieldDescriptor Id="PLANET1" FieldName="_primaryKey" ColumnName="PLANET_ID" DbType="Int32" IsComputed="true"/>
		</PrimaryKeyDescriptor>
		<FieldDescriptor Id="PLANET2" FieldName="_starId" ColumnName="STAR_ID" DbType="Int32"/>
		<FieldDescriptor Id="PLANET3" FieldName="_name" ColumnName="NAME" DbType="AnsiString"/>
		<FieldDescriptor Id="PLANET4" FieldName="_rotationalPeriod" ColumnName="ROTATIONAL_PERIOD" DbType="Decimal"/>
		<!-- ReferenceDescriptor - defines a field that will hold the persistable -->
		<!--                       object instance referenced by a foreign key.   -->
		<ReferenceDescriptor Id="Planet_ReferenceTo_Star" FieldName="_star" RelatedClassName="DomainObjects.Tutorial.Star">
			<ForeignKeyFieldId>PLANET2</ForeignKeyFieldId>
		</ReferenceDescriptor>
		<!-- CollectionDescriptor - defines a field that will hold the set of persistable  -->
		<!--                        object instances referenced by an inverse foreign key. -->
		<CollectionDescriptor Id="Planet_CollectionOf_PlanetarySatellite" FieldName="_mySatellites" RelatedClassName="DomainObjects.Tutorial.PlanetarySatellite">
			<InverseForeignKeyFieldId>PLANETARY_SATELLITE2</InverseForeignKeyFieldId>
		</CollectionDescriptor>
	</ClassDescriptor>
	<!--                                                                 -->
	<!-- Mapping for the Tutorial.PlanetarySatellite persistable object. -->
	<!--                                                                 -->
	<ClassDescriptor ClassName="DomainObjects.Tutorial.PlanetarySatellite" TableName="PLANETARY_SATELLITE">
		<PrimaryKeyDescriptor>
			<FieldDescriptor Id="PLANETARY_SATELLITE1" FieldName="_primaryKey" ColumnName="PLANETARY_SATELLITE_ID" DbType="Int32" IsComputed="true"/>
		</PrimaryKeyDescriptor>
		<FieldDescriptor Id="PLANETARY_SATELLITE2" FieldName="_planetId" ColumnName="PLANET_ID" DbType="Int32"/>
		<FieldDescriptor Id="PLANETARY_SATELLITE3" FieldName="_name" ColumnName="NAME" DbType="AnsiString"/>
		<!-- ReferenceDescriptor - defines a field that will hold the value of a   -->
		<!--                       persistable object referenced by a foreign key. -->
		<ReferenceDescriptor Id="PlanetarySatellite_ReferenceTo_Planet" FieldName="_planet" RelatedClassName="DomainObjects.Tutorial.Planet">
			<ForeignKeyFieldId>PLANETARY_SATELLITE2</ForeignKeyFieldId>
		</ReferenceDescriptor>
	</ClassDescriptor>
</DescriptorRepository>
