简体   繁体   中英

hibernate 4 and joda-LocalDate and persist it as SQL Date

链接几乎是我所需要的,但是它将LocalDate保留为Raw(255)保留在我的oracle数据库上,所以我的问题是如何将joda LocalDate保留为sql date?

Ok, finally.

For my case, if I use org.jadira.usertype. somehow it persists the localdate as raw(255) on oracle.

    <dependency>
        <groupId>org.jadira.usertype</groupId>
        <artifactId>usertype.core</artifactId>
        <version>3.1.0.CR10</version>
    </dependency>

so if i change it to joda-time-hibernate, it seems working fine now, it persists as sql date.

    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time-hibernate</artifactId>
        <version>1.3</version>
    </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM