<?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="AssessmentCriteriaTemplate"   package="performa.orm">
        
        <IMPORT value="oneit.security.*"/>
                
        <MULTIPLEREFERENCE  name="AssessmentCriterias"  type="AssessmentCriteria"   backreferenceName="Template" />
        
        <TABLE  name="tl_assessment_template"   tablePrefix="object"    polymorphic="FALSE">
            
            <ATTRIB name="TemplateName" type="String"   dbcol="template_name"   length="100"    uniqueGroup="TemplateName"/>
            
            <SINGLEREFERENCE    name="User" type="SecUser"  dbcol="user_id" uniqueGroup="TemplateName"/>

        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_assessment_template.object_id is not null"  orderBy="tl_assessment_template.object_id"   />
            
        <SEARCH type="Company"  paramFilter="tl_assessment_template.object_id is not null"  orderBy="tl_assessment_template.object_id">
            <TABLE  name="oneit_sec_user_extension" join="oneit_sec_user_extension.user_id = tl_assessment_template.user_id"/>
            <TABLE  name="tl_company"               join="tl_company.object_id = oneit_sec_user_extension.company_id"/>
            <PARAM name="Company"   type="Company"  transform="Company.getObjectID ()"  paramFilter="tl_company.object_id = ${Company}"/>
        </SEARCH>
        
    </BUSINESSCLASS>
    
</ROOT>