JDBC类型的无Dialect映射:2003(No Dialect mapping for JDBC type: 2003)

编程入门 行业动态 更新时间:2024-10-26 00:29:08
JDBC类型的无Dialect映射:2003(No Dialect mapping for JDBC type: 2003)

虽然这个标题存在一些问题,但我的查询并没有从那些线程中解决。

我在postgres中通过hibernate执行递归(使用with子句)查询,查询结果包含搜索路径

例如:一行查询结果

5811;"axyz_3_3";"ABC";5782;5811;5797;4;"**{acl_3_3,acl3_4,acl3,acl_3_3}**";t;t

除了String之外,hibernate是否具有"{acl_3_3,acl3_4,acl3,acl_3_3}"任何映射类型,类似于CHARACTER_ARRAY或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抛出异常

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类型的Dialect映射:2003

Though there are some question exists with this title , but my query does not solve from those thread.

I am executing recursive (using with clause) query through hibernate in postgres, query's result contains path of search also

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

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.

Below is the sample of the query's output

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 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

Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003

最满意答案

Hibernate没有提供和转换DB text []数据类型的Converter类/ Mapper类,为此我们可以编写我们自己的转换类型实现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 ','

更多推荐

本文发布于:2023-07-16 07:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125428.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类型   Dialect   JDBC   type   mapping

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!