Hi All,

When i filter an OQL query based on second identity column (primary key
for this class includes 2 columns) i am getting the following error:

An unknown field was requested: empId

For the first column it is fine. If i change the mapping file to include
only my second column as identity then also it is working fine.

Any idea?

mapping:
<class name="Employee" identity="deptId empId">

        <map-to table="DEPARTMENT" xml="Department" />

                <field name="deptId" type="String" >
                        <sql name="DEPT_ID" type="char"/>
                        <xml node="attribute"/>
                </field>

                <field name="empId" type="string" >
                        <sql name="EMP_ID" type="char"/>
                        <xml node="element"/>
                </field>
                
                <field name="empName" type="string" >
                        <sql name="EMP_NAME" type="char"/>
                        <xml node="element"/>
                </field>        

My OQL:

SELECT p FROM Employee p WHERE p.deptId = $1 AND p.empId=$2

I am able to filer on other fields line empName

Thanks
Ramki

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to