JDBC类型没有方言映射:2003 [英] No Dialect mapping for JDBC type: 2003
问题描述
尽管此标题存在一些问题,但我的查询无法从那些线程中解决.
Though there are some question exists with this title , but my query does not solve from those thread.
我正在通过postgres中的hibernate执行递归查询(使用with子句),查询结果也包含搜索路径
I am executing recursive (using with clause) query through hibernate in postgres, query's result contains path of search also
ex:查询结果的一行
ex: one row of query result
5811;"axyz_3_3";"ABC";5782;5811;5797;4;"**{acl_3_3,acl3_4,acl3,acl_3_3}**";t;t
休眠状态是否为String以外的任何"{acl_3_3,acl3_4,acl3,acl_3_3}"
映射类型,
类似于CHARACTER_ARRAY
或CHAR_ARRAY
.
Does hibernate has any mapping type for "{acl_3_3,acl3_4,acl3,acl_3_3}"
other than String,
something similar to CHARACTER_ARRAY
or CHAR_ARRAY
.
下面是查询输出的示例
id |name|discri|pId|asscID|immeId|depth|path|cycle|canDelete
5797;"abc3";"abc";5782;5811;5788;7;"{abc_3_3,abc3_4,abc3,abc4}";t;f
5797;"abc3";"abc";5782;5786;5813;6;"{abc1,abc2,abc3,abc3}";t;f
5799;"abc4";"abc";5782;5811;5786;6;"{abc_3_3,abc3_4,abc4}";t;f
5788;"abc2";"abc";5782;5811;5786;6;"{abc_3_3,abc3_4,abc2}";f;f
5786;"abc1";"abc";5782;5786;5799;5;"{abc1,abc2,abc3,abc1}";t;f
5797;"abc3";"abc";5782;5786;5813;5;"{abc1,abc2,abc3,abc3}";t;f
5813;"abc3_4";"abc";5782;5786;5811;5;"{abc1,abc2,abc3_4}";f;f
5786;"abc1";"abc";5782;5811;5799;5;"{abc_3_3,abc4,abc1}";f;f
5813;"abc3_4";"abc";5782;5811;5797;4;"{abc3_4,abc3,abc3_4}";t;f
5811;"abc_3_3";"abc";5782;5811;5797;4;"{abc_3_3,abc3,abc_3_3}";t;t
5799;"abc4";"abc";5782;5811;5797;4;"{abc3,abc4}";f;f
Hibernate抛出异常
Hibernate is throwing below exception
Caused by: com.vik.prod.service.UnidentifiedException: No Dialect mapping for JDBC type: 2003
at com.vik.prod.service.ServiceExecutorUtils.execute(ServiceExecutorUtils.java:93)
at com.vik.prod.service.ServerServiceExecutor.execute(ServerServiceExecutor.java:76)
at com.vik.prod.service.ClientDelegate.execute(ClientDelegate.java:197)
... 33 more
由以下原因引起:org.hibernate.MappingException:没有JDBC类型的方言映射:2003
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
推荐答案
Hibernate不提供和Converter类/Mapper类来转换DB text []数据类型, 为此,我们可以编写实现 UserType ,或者我们使用 sqlQuery.addScalar("path",Hibernate.TEXT);我们可以将text []映射到文本,然后在Java代码中将其与','
Hibernate does not provide and Converter class/Mapper class to convert DB text[] datatype, For this either we can write our own converted type implementing UserType or we using sqlQuery.addScalar( "path", Hibernate.TEXT ); we can map text[] to text and then in java code we can split it from ','
这篇关于JDBC类型没有方言映射:2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!