views:

243

answers:

2

What is the FieldBridge for timestamp in HIbernate Search?

@Field

public java.sql.Timestamp approvedDate;

+1  A: 

When looking at the BridgeFactory source code, it seems there is no default FieldBridge for timestamps.

I think you should provide your own custom FieldBridge.

Laurent Simon
A: 

I was having the same problem for a long time. first I convert Timestamp to Date for some class. but when I have problem from deeper level I could not change the whole code. anyway long story short here is what I use

@Field(index=Index.UN_TOKENIZED)
@DateBridge(resolution=Resolution.MILLISECOND)
public Timestamp getCreated(){
  return super.getCreated();
}

and the good thing it is working fine :)

özkan pakdil