Spring Data Querying DateTime with only Date

前端 未结 3 965
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 01:00

I have this Data Model

public class CustomerModel{

  @Column
  @Type(type=\"org.joda.time.contrib.hibernate.PersistentDateTime\")
  private DateTime members         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 01:19

    You can do some workaround: create DateTime dayBegin and DateTime dayEnd which are e.g. 2013-07-04 00:00:00 and 2013-07-04 23:59:59 and fetch needed objects by query:

    List findByMembershipBetween(DateTime dayBegin, DateTime dayEnd);
    

提交回复
热议问题