on 01-16-2007 5:03 PM
Hi,
I'm getting NullpointException errors when attempting to run a query search from the header and item tables combined. Is it possible to do this?
SmartSyncJQueryFactory jquery = SmartSyncRuntime.getInstance().getJQueryFactory();
//get field names then implement their attributes.
JQueryAttribute[] jattrHeader = dmod.getHeaderAttributes();
JQueryAttribute[] jattrItem = dmod.getItemAttributes();
int i;
for( i = 0; i < jattr.length; i++ )
{
compJattr<i> = jattr<i>;
}
for(int x=0; x < jattr2.length; x++)
{
i++;
compJattr<i> = jattr2[x];
System.out.println("Appending jattr2: " + i + ":" + compJattr<i>);
if(i == 38)
break;
}
JQueryCondition compcond = jquery.createCondition( new JQueryCondition[] { jcond1Header, jcond2Item },
LogicalOperatorType.OR);
JQuery query = jquery.createQuery(compJattr, compcond , jsort);
if(query!=null)
{
queryResult = dataFacade.executeQuery(query);
iteratorSyncBos = queryResult.iterator();
System.out.println("@@@@@@Query is successful....");
}
The null point exception occurs here:
JQuery query = jquery.createQuery(compJattr, compcond , jsort);
Thanks,
Chiedu
Hi Chiedu,
Are you sure that all the three (compJattr, compcond , jsort) attributes are not null before executing the below statement..
JQuery query = jquery.createQuery(compJattr, compcond , jsort);
Cheers,
Karthick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthick,
Thanks for the feedback. I checked all attributes prior to passing them to createQuery() method by viewing the stored data.
If i remove all attributes for the Item, item attribute and item condition. the function works. Is there a rule against combining header and item attributes together to perform a query?
Thanks,
Chiedu
I discovered one of my params to be null.
Thanks,
Chiedu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chiedu,
Its nice to know that the problem is resolved.
Kindly award the appropriate points and then close the Question.
<<<Are you sure that all the three (compJattr, compcond , jsort) attributes are not null before executing the below statement..
JQuery query = jquery.createQuery(compJattr, compcond , jsort);>>>>
Cheers,
Karthick
hello chiedu,
from your codes, though you did not post the line which initializes the compJattr
array, there's a high possibility that some elements of this array are null. be sure
that all elements are not null before passing it to <i>query.createQuery</i> method.
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.