Skip to main content
added 54 characters in body
Source Link
Dominic Cronin
  • 18.5k
  • 3
  • 23
  • 74

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_SCHEMA_ID, 
                                                SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_SCHEMA_ID, SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_SCHEMA_ID, 
                                                SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

added 4 characters in body
Source Link
Siva Charan
  • 4.3k
  • 1
  • 20
  • 36

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_TITLEITEMS_SCHEMA_ID, SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_TITLE, SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_SCHEMA_ID, SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet

Source Link
Siva Charan
  • 4.3k
  • 1
  • 20
  • 36

Try this way:-

Query myQuery = new Query();

Criteria myCriteria = null;
ItemTypeCriteria isSchema = new ItemTypeCriteria(8);
PublicationCriteria pubCriteria = new PublicationCriteria(251);
AndCriteria andCriteria = new AndCriteria(isSchema, pubCriteria);

myCriteria = andCriteria;

myQuery.setCriteria(myCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ITEMS_TITLE, SortParameter.ASCENDING);

myQuery.addSorting(sortParameter);
//myQuery.setResultFilter(new LimitFilter(25));

String[] itemResults = myQuery.executeQuery();
System.out.println("RESULTS: " + itemResults.length); 

Note that I haven't tested yet