<?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="EmailMessage"   package="performa.orm">
        
        <MULTIPLEREFERENCE  name="Attachments"    type="Attachment"          backreferenceName="EmailMessage"/>
                
        <TABLE  name="tl_email_message" tablePrefix="object"    polymorphic="FALSE">
            
            <ATTRIB name="MessageId"            type="String"               dbcol="message_id"                  length="1000"   />
            <ATTRIB name="EmailFrom"            type="String"               dbcol="email_from"                  length="500"    mandatory="true"/>
            <ATTRIB name="EmailTo"              type="String"               dbcol="email_to"                    length="500"    mandatory="true"/>
            <ATTRIB name="EmailCC"              type="String"               dbcol="email_cc"                    length="500"    />
            <ATTRIB name="Subject"              type="String"               dbcol="subject"                     length="1000"   />
            <ATTRIB name="Description"          type="String"               dbcol="description"                 />
            <ATTRIB name="ReceivedDate"         type="Date"                 dbcol="received_date"               mandatory="true"/>
            
            <SINGLEREFERENCE    name="Job"      type="Job"                  dbcol="job_id"  />
        </TABLE>

        <SEARCH type="All"  paramFilter="tl_email_message.object_id is not null"/>
        
    </BUSINESSCLASS>

</ROOT>