Batakj
Batakj

Reputation: 12743

FieldBridge for Timestamp in Hibernate Search

What is the FieldBridge for timestamp in HIbernate Search?

@Field

public java.sql.Timestamp approvedDate;

Upvotes: 1

Views: 1296

Answers (2)

ozkanpakdil
ozkanpakdil

Reputation: 4612

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 :)

Upvotes: 0

Laurent Simon
Laurent Simon

Reputation: 582

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.

Upvotes: 2

Related Questions