<?xml version="1.0" encoding="UTF-8"?>

<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>

    <BUSINESSCLASS  name="ScheduledEmail"   package="performa.orm">
        
        <IMPORT value="performa.orm.types.*"/>
        
        <TABLE  name="tl_scheduled_email" tablePrefix="object">
                        
            <ATTRIB name="Subject"              type="String"               dbcol="subject"             mandatory="true"    length="200"    />
            <ATTRIB name="ScheduledDate"        type="Date"                 dbcol="scheduled_date"      mandatory="true"    />
            <ATTRIB name="ApplicationStatus"    type="ApplicationStatus"    dbcol="application_status"  mandatory="true"    attribHelper="EnumeratedAttributeHelper"    />
            <ATTRIB name="MessageContent"       type="String"               dbcol="message_content"     mandatory="true"    />

            <SINGLEREFERENCE    name="JobApplication"   type="JobApplication"   dbcol="job_application_id"      backreferenceName="ScheduledEmails" mandatory="true"/>
            <SINGLEREFERENCE    name="MessageTemplate"  type="MessageTemplate"  dbcol="message_template_id"     />
            
        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_scheduled_email.object_id is not null"   orderBy="tl_scheduled_email.object_id">
        </SEARCH>
        
    </BUSINESSCLASS>
    
</ROOT>