Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Dev List »

[hibernate-dev] [infinispan-dev] Querying Infinispan -- Not
 fetching results

Vidya Sethuraman

2010-02-15

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I am able to load data in cache and display. When I try to query, I am
getting an empty list.
Following is the code snippet. Please let me know what I am doing wrong.

---------------------TestRecord.java----------------
@ProvidedId(bridge = @FieldBridge(impl = StringBridge.class))
@Indexed(index = "testRecord")
public class TestRecord implements Serializable {

//   @Field(store = Store.YES)
  private Date today = new java.util.Date();
//   @Field(store = Store.YES)
  private Timestamp time = new Timestamp(today.getTime());
  @Field(store = Store.YES)
  private String type;
  @Field(store = Store.YES)
  private String eventType;
  @Field(store = Store.YES)
  private int loggingLevel;
  @Field(store = Store.YES)
  private String message;
//   @Field(store = Store.YES)
  private String logTime = time.toString();

...// getters and setters
}

-----TestQuery.java----------
cache = cacheMgr.getCache();
QueryHelper qh = new QueryHelper(cache, new Properties(), TestRecord.class);
QueryFactory qf = new QueryFactory(cache, qh);
CacheQuery cq = qf.getBasicQuery("message", searchText);
auditLogRecordList = cq.list();
int hits = cq.getResultSize();
log.info("hits= "+ hits);
--------------------------------------------

The hits is appearing empty.

Regards,
Vidya
_______________________________________________
hibernate-dev mailing list
hibernate-dev@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-dev
©2008 gg3721.com - Jax Systems, LLC, U.S.A.