on 02-01-2008 7:07 AM
Hi All,
I am getting following error while creating a multiple condition query.
ERROR:java.lang.IllegalArgumentException: Unexpected field type for 😧 java.lang.String
I am pasting the scrap of the code for review below.
pls note after removing the condition cond6; it works fine, and cond6 is for date type field.
for(int j=1;j<7;j++){
fd[j] =trd.getFieldDescriptor(arrayHeaderFieldNames[j]);
BasisFieldType bft1 = fd[j].getFieldType();
if (bft1 == BasisFieldType.C) {
filterOperator[j] = RelationalOperatorType.CONTAINS; }
else{
filterOperator[j] = RelationalOperatorType.EQUALS;
}
order[j] =queryFactory.createSortOrder(fd[j],true);
}
cond1 =queryFactory.createCondition(fd[1], filterOperator[1], values[0]);
cond2 =queryFactory.createCondition(fd[2], filterOperator[2], values[1]);
cond3 =queryFactory.createCondition(fd[3], filterOperator[3], values[2]);
cond4 =queryFactory.createCondition(fd[4], filterOperator[4], values[3]);
cond5 =queryFactory.createCondition(fd[5], filterOperator[5], values[4]);
cond6 =queryFactory.createCondition(fd[6], filterOperator[6], values[5]);
Condition cond = queryFactory.createCondition(new Condition[]{cond1,cond2,cond3,cond4,cond5,cond6},LogicalOperatorType.AND);
Please Help!
Thanks n regards,
Kapoorchand.
Hi All,
Can anybody give help me giving the code to query the date field on the client to solve the above mentioned problem.
Thanks & regards,
Kapoorchand.
Edited by: Kapoorchand Vishwakarma on Feb 4, 2008 5:18 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
well that problem is a long time back -. I only have in mind that the date I had to transfer to the quesry was in a "strange" format. Have a lock into the documentation for the date field - your date field is not recognised as a date field from the quesry engine and so this fails - but unfortunately I have no idea at the moment how I fixed it last time - how I converted my date field......
Sorry, thast I can not give you the real point - but I will have a lock into the old code - hopefully I find it soon.
Regards,
Oliver
Hi Oliver,
Thanks for your kind interest!
well, I have found the solution by myself .
I converted the value using java.sql.Date.valueOf(values[5]) before preparing the condition. that helped.
points for reply awarded.
kind regards,
Kapoorchand.
Edited by: Kapoorchand Vishwakarma on Feb 5, 2008 5:03 AM
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.