Skip to Content
0
Former Member
Jan 16, 2007 at 05:03 PM

Searching header and item objects from one createQuery

17 Views

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