<?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="Client"   package="performa.orm">
        
        <IMPORT value="performa.orm.types.*"/>
        <IMPORT value="oneit.business.shopping.orm.*"/>
        
        <MULTIPLEREFERENCE  name="Jobs" type="Job"  backreferenceName="Client" />

        <TABLE  name="tl_client" tablePrefix="object">
            
            <ATTRIB name="ClientName"      type="String"            dbcol="client_name"         mandatory="true"    length="100"/>
            <ATTRIB name="ClientLogo"      type="BinaryContent"     dbcol="client_logo"         mandatory="false"   binaryHandler="loggedin"    attribHelper="BLOBAttributeHelper"  attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
            <ATTRIB name="Email"            type="String"           dbcol="email"               mandatory="false"   length="100"                validators="Email"  />
            <ATTRIB name="ContactName"      type="String"           dbcol="contact_name"        mandatory="false"   length="100"/>
            <ATTRIB name="ContactSurname"   type="String"           dbcol="contact_surname"     mandatory="false"   length="100"/>
            <ATTRIB name="Phone"            type="String"           dbcol="phone"               mandatory="false"   length="30" />
            <ATTRIB name="State"            type="State"            dbcol="state"               mandatory="false"   defaultValue="State.WA"     attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="Country"          type="Countries"        dbcol="country"             mandatory="false"   defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="PostCode"         type="String"           dbcol="post_code"           mandatory="false"   length="10"/>

        
            <SINGLEREFERENCE    name="Company"  type="Company"  dbcol="company_id"  backreferenceName="Clients"/>
            
        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_client.object_id is not null"   orderBy="tl_client.object_id">
        </SEARCH>
        
    </BUSINESSCLASS>
    
</ROOT>