<?xml version="1.0" encoding="utf-8"?>
<data-map project-version="1.1">
	<property name="defaultPackage" value="cayenne.tutorial"/>
	<db-entity name="ARTIST">
		<db-attribute name="DATE_OF_BIRTH" type="DATE"/>
		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
		<db-attribute name="NAME" type="VARCHAR" length="200"/>
	</db-entity>
	<db-entity name="GALLERY">
		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
		<db-attribute name="NAME" type="VARCHAR" length="200"/>
	</db-entity>
	<db-entity name="PAINTING">
		<db-attribute name="ARTIST_ID" type="INTEGER"/>
		<db-attribute name="GALLERY_ID" type="INTEGER"/>
		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
		<db-attribute name="NAME" type="VARCHAR" length="200"/>
	</db-entity>
	<obj-entity name="Artist" className="cayenne.tutorial.Artist" dbEntityName="ARTIST">
		<obj-attribute name="dateOfBirth" type="java.util.Date" db-attribute-path="DATE_OF_BIRTH"/>
		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
	</obj-entity>
	<obj-entity name="Gallery" className="cayenne.tutorial.Gallery" dbEntityName="GALLERY">
		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
	</obj-entity>
	<obj-entity name="Painting" className="cayenne.tutorial.Painting" dbEntityName="PAINTING">
		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
	</obj-entity>
	<db-relationship name="paintings" source="ARTIST" target="PAINTING" toMany="true">
		<db-attribute-pair source="ID" target="ARTIST_ID"/>
	</db-relationship>
	<db-relationship name="paintings" source="GALLERY" target="PAINTING" toMany="true">
		<db-attribute-pair source="ID" target="GALLERY_ID"/>
	</db-relationship>
	<db-relationship name="artist" source="PAINTING" target="ARTIST" toMany="false">
		<db-attribute-pair source="ARTIST_ID" target="ID"/>
	</db-relationship>
	<db-relationship name="gallery" source="PAINTING" target="GALLERY" toMany="false">
		<db-attribute-pair source="GALLERY_ID" target="ID"/>
	</db-relationship>
	<obj-relationship name="paintings" source="Artist" target="Painting" deleteRule="Cascade" db-relationship-path="paintings"/>
	<obj-relationship name="paintings" source="Gallery" target="Painting" deleteRule="Cascade" db-relationship-path="paintings"/>
	<obj-relationship name="artist" source="Painting" target="Artist" deleteRule="Nullify" db-relationship-path="artist"/>
	<obj-relationship name="gallery" source="Painting" target="Gallery" deleteRule="Nullify" db-relationship-path="gallery"/>
	<query name="DeleteAll" factory="org.apache.cayenne.map.SQLTemplateBuilder" root="data-map" root-name="UntitledDomainMap">
		<property name="cayenne.GenericSelectQuery.fetchingDataRows" value="true"/>
		<sql><![CDATA[delete from $table]]></sql>
	</query>
</data-map>
