hibernate 4 and joda-time

后端 未结 2 1721
后悔当初
后悔当初 2020-11-30 21:06

are they happily married ?

I am using the latest version of hibernate (4) and version 1.3 of joda-time hibernate support, which I also believe to be the current late

2条回答
  •  孤独总比滥情好
    2020-11-30 22:03

    A distinct paucity of documentation, means it might be helpful for me to write down the steps required for integration. Make sure your libraries are up to date.

    You'll need : [assuming you already have hibernate4]

    Latest version of joda-time

    
        joda-time
        joda-time
        2.0
    
    

    and usertype lib

    
        org.jadira.usertype
        usertype.core
        3.0.0.CR1
    
    

    Then use the following in entity classes (doesn't have to be LocalDateTime, could be any of the persisted classes available) :

    import org.joda.time.LocalDateTime;
    

    and for column definition:

    @Column(name="updated", nullable = false)
    @Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime updated;
    

提交回复
热议问题