<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE database SYSTEM "../dtd/database.dtd">

<database package="core.book" name="bookstore" defaultIdMethod="native">

  <!-- This table exists to explore/test the handling of BLOB/CLOB objects. -->
  <table name="media">
   <behavior name="auto_add_pk" />
    <column
      name="cover_image"
      type="BLOB"
      lazyLoad="true"
      description="The image of the book cover."/>
	<column
      name="excerpt"
      type="CLOB"
      lazyLoad="true"
      description="An excerpt from the book."/>
	<column
	  name="book_id"
	  required="true"
	  type="INTEGER"
	  description="Book ID for this media collection."/>
	<foreign-key foreignTable="book" onDelete="CASCADE">
      <reference
        local="book_id"
        foreign="id"/>
    </foreign-key>
  </table>

</database>
