@Column(name = "CREATED")
@Temporal(TemporalType.TIMESTAMP)
@DateBridge(resolution = Resolution.DAY)
private Date created;
My solution was to write a custom field bridge named ESTDateBridge by copying the original DateBridge code and changing the default timezone from GMT to "America/New_York" (writing EST did not work..)The working annotation is as follows:
@Column(name = "CREATED")
@Temporal(TemporalType.TIMESTAMP)
@FieldBridge(impl = ESTDateBridge.class)
private Date created;
Some references:
http://jamesjefferies.com/2009/04/22/hibernate-search-lucene-and-greenwich-mean-time/
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.4/html/Infinispan_Query_Guide/sect-Bridges.html
https://forum.hibernate.org/viewtopic.php?f=9&t=990266&view=next
Hiç yorum yok:
Yorum Gönder