datetimeoffset hibernate映射 [英] datetimeoffset hibernate mapping

查看:112
本文介绍了datetimeoffset hibernate映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用hibernate与ms sql server,并有困难映射sql类型datetimeoffset到java。
如果我尝试在逆向工程配置中设置映射类型:



我收到一条错误说sth。像
org.hibernate.MappingException:jdbc-type:microsoft.sql.Types.DATETIMEOFFSET不是已知的JDBC类型或有效的数字



我只想任何关于如何解决这个问题的想法?



>解决方案

您可以提供自定义的Hibernate用户类型。例如通过实现org.hibernate.type.MutableType。



参考 Hibernate参考了解更多信息。


I'm trying to use hibernate with ms sql server and have difficulties mapping the sql type datetimeoffset to java. If I try to set the mapping type in the reverse engineering configuration with:

I get an error saying sth. like org.hibernate.MappingException: jdbc-type: microsoft.sql.Types.DATETIMEOFFSET is not a known JDBC Type nor a valid number

I guess only the detault jdbc types can be used in this context.

Any ideas about how to solve this issue?

解决方案

Your can provide a custom Hibernate user type. For example by implementing org.hibernate.type.MutableType.

Refer Hibernate Reference for more information.

这篇关于datetimeoffset hibernate映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆