13

私はこのデータモデルを持っています

public class CustomerModel{

  @Column
  @Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")
  private DateTime membershipDate;
  //Other properties and getters
}

そして、次のレポ

public interface CustomerRepo  extends Repository<CustomerModel, Long>{}

やりたいことは。特定の日付 (2013 年 8 月 1 日に参加したメンバー) のすべてのユーザーを取得しますが、私の DB では、membershipDate に時間が含まれているという問題があります。時間を無視して、特定の日付のすべてのユーザーを取得するにはどうすればよいですか?

4

3 に答える 3

3

jODA と spring & JPA は実際には良い友達です。

http://blog.netgloo.com/2015/04/06/spring-boot-using-joda-time-on-jpa-entity-with-hibernate/

楽しい

于 2016-01-26T15:48:34.063 に答える