Package com.google.code.hs4j

Examples of com.google.code.hs4j.Filter


    // find twice
    rs = this.hsClient.find(indexId, new String[] { "dennis" });
    assertTrue(rs.next());

    // find three times
    rs = this.hsClient.find(indexId, new String[] { "dennis" }, FindOperator.EQ, 1, 0, new Filter[]{new Filter(FilterType.FILTER, FindOperator.EQ, 0, "25")});
    assertFalse(rs.next());
    rs = this.hsClient.find(indexId, new String[] { "dennis" }, FindOperator.EQ, 1, 0, new Filter[]{new Filter(FilterType.FILTER, FindOperator.EQ, 0, "27")});
    assertTrue(rs.next());

    System.out.println(rs.getInt("user_id"));
    assertEquals("dennis", rs.getString("user_name"));
    assertEquals("killme2008@gmail.com", rs.getString("user_email"));
View Full Code Here


        1,
        stmt
            .executeUpdate("insert into test_user values(0,'dennis','test@163.com','27','2010-11-28 13:24:00')"));

    final String[] keys = { "dennis", "test@163.com" };
    Filter[] filters ={new Filter(FilterType.FILTER,FindOperator.EQ, 0, "27")};
    ResultSet rs = session.find(keys,FindOperator.EQ,1,0,filters);
    assertTrue(rs.next());

    System.out.println(rs.getInt(1));
    assertEquals("dennis", rs.getString(2));
    assertEquals("test@163.com", rs.getString(3));
    assertEquals(27, rs.getInt(4));
    assertFalse(rs.next());

    filters = new Filter[]{new Filter(FilterType.FILTER,FindOperator.GT, 0, "27")};
    rs = session.find(keys,FindOperator.EQ,1,0,filters);
    assertFalse(rs.next());   
  }
View Full Code Here

    final String id = "1";
    final String[] keys = { "dennis" };
    int limit = 40;
    int offset = 0;
    final String[] fieldList = { "id", "name", "password" };
    final Filter[] filterList = { new Filter(FilterType.FILTER,FindOperator.EQ,1,"27") };
    return new FindCommand(id, FindOperator.EQ, keys, limit, offset,
        fieldList,filterList);
  }
View Full Code Here

    String fcol[] = new String[flen];
    byte fval[][] = new byte[flen][];
   
    int filterAllLength=0;
    for(int i=0; i< flen;i++) {
      Filter f = filters[i];
      ftype[i] = f.getType().getValue();
      fop[i] = f.getOperator().getValue();
      fcol[i] = String.valueOf(f.getColumn());
      fval[i] = HSUtils.decodeString(f.getValue(),this.encoding);
      filterAllLength += ftype[i].length()+1 + fop.length+1 + fcol[i].length()+1 + fval[i].length+1;
    }

    int capacity = this.id.length() + 1
        + this.operator.length() + 1 + kenLen.length() + 1
View Full Code Here

TOP

Related Classes of com.google.code.hs4j.Filter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.