<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
    <package>org.apache.roller.weblogger.pojos</package>
    <entity metadata-complete="true" name="MediaFileDirectory"
            class="org.apache.roller.weblogger.pojos.MediaFileDirectory" access="PROPERTY">
        <table name="roller_mediafiledir"/>
        <named-query name="MediaFileDirectory.getByWeblog">
            <query>SELECT d FROM MediaFileDirectory d WHERE d.weblog = ?1</query>
        </named-query>
        <named-query name="MediaFileDirectory.getByWeblogAndName">
            <query>SELECT d FROM MediaFileDirectory d WHERE d.weblog = ?1 AND d.name = ?2</query>
        </named-query>
        <attributes>
            <id name="id">
                <column name="id"/>
            </id>
            <basic name="name">
                <column name="name" insertable="true" updatable="true" unique="false" nullable="false"/>
            </basic>
            <basic name="description">
                <column name="description" insertable="true" updatable="true" unique="false" nullable="true"/>
            </basic>
            <many-to-one name="weblog" target-entity="org.apache.roller.weblogger.pojos.Weblog">
                <join-column name="websiteid" insertable="true" updatable="true" nullable="false"/>
            </many-to-one>
            <one-to-many name="mediaFiles" mapped-by="directory" target-entity="org.apache.roller.weblogger.pojos.MediaFile" fetch="LAZY">
                <order-by>name</order-by>
                <cascade>
                    <cascade-persist/>
                    <cascade-remove/>
                </cascade>
            </one-to-many>
            <transient name="empty"/>
        </attributes>
    </entity>
</entity-mappings>
