简体   繁体   English

休眠4和joda-LocalDate并将其保留为SQL Date

[英]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. 就我而言,如果我使用org.jadira.usertype。 somehow it persists the localdate as raw(255) on oracle. 它以某种方式在Oracle上将localdate保留为raw(255)。

    <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. 因此,如果我将其更改为joda-time-hibernate,则现在看起来工作正常,它作为sql date持续存在。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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