冬眠4和乔达时间

冬眠4和乔达时间,第1张

冬眠4和乔达时间

很少有文档说明,这可能有助于我写下集成所需的步骤。确保您的库是最新的。

您需要:[假设您已经有hibernate4]

最新版本的乔达时间

<dependency>    <groupId>joda-time</groupId>    <artifactId>joda-time</artifactId>    <version>2.0</version></dependency>

和用户类型库

<dependency>    <groupId>org.jadira.usertype</groupId>    <artifactId>usertype.core</artifactId>    <version>3.0.0.CR1</version></dependency>

然后在实体类中使用以下内容(不必是LocalDateTime,可以是任何可用的持久化类):

import org.joda.time.LocalDateTime;

对于列定义:

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


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5478699.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存