views:

19

answers:

1
  public List<Orders> GetOrders(String email,String icode,String c1, String c2, String c3) 
     { 
         PersistenceManager pm = PMF.get().getPersistenceManager(); 
         Query query = pm.newQuery(Orders.class);  
         query.setFilter("Email == pEmail && ItemCode == pItemCode && Col1 == pCol1 && Col2 == pCol2 && Col3 == pCol3"); 
         query.declareParameters("String pEmail, String pItemCode, String pCol1, String pCol2, String pCol3"); 
         query.setRange(0,50);        
         query.setOrdering("Id desc"); 
         return (List<Orders>) query.execute(email,icode,c1,c2,c3); 
     }

The above code gives error because maximum 3 arguments can be passed to execute method. Is there a way to get data from google datastore using more than 3 column filter?

+2  A: 

Yes - just use the executeWithArray method or the executeWithMap method.

Nick Johnson