出现错误的原因是:hibernate中对于数据库的longtext数据类型不支持。

解决方案:

1、写个类集成方言,然后自己实现对longtext的支持

 import java.sql.Types;
import org.hibernate.dialect.MySQL5Dialect;
public class DialectForInkfish extends MySQL5Dialect {
public DialectForInkfish() {
super();
registerHibernateType(Types.LONGVARCHAR, 65535, "longtext");
}
}

2、修改hibernate.cfg.xml配置文件

将<property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>  改为<property name="dialect">com.ibm.crl.inkfish.config.DialectForInkfish</property>

Hibernate映射数据库中longtext类型属性时报错No Dialect mapping for JDBC type: -1的解决方案的更多相关文章

  1. 关于No Dialect mapping for JDBC type :-9 hibernate执行原生sql语句问题

    转自博客http://blog.csdn.net/xd195666916/article/details/5419316,同时感谢博主 今天做了个用hibernate直接执行原生sql的查询,报错No ...

  2. hibernate:MySQL No Dialect mapping for JDBC type: -1

    出处:(hibernate中使用原生的sql语句,报如下错误:) MySQL No Dialect mapping for JDBC type: -1 代码: List list = session. ...

  3. 1.org.hibernate.MappingException: No Dialect mapping for JDBC type: -9

    org.hibernate.MappingException: No Dialect mapping for JDBC type: -9 原因:Hibernate框架的方言(Dialect )没有数据 ...

  4. Hibernate 数据库方言配置;no dialect mapping for jdbc type:-9;生僻字

    最近因为生僻字在界面上显示为?: 主要原因是该字段在数据库中就是varchar类型,显示的就是?:如䶮(yan):现把varchar类型改为nvarchar类型:数据中能够正常显示: 但是Spring ...

  5. hibernate报错:org.hibernate.MappingException: No Dialect mapping for JDBC type: -1

    解决方法:自定义一个Hibernate Dialect. package com.yourcompany.util ; import java.sql.Types; import org.hibern ...

  6. springboot org.hibernate.MappingException: No Dialect mapping for JDBC type: -9

    参考 https://www.cnblogs.com/luxd/p/8316243.html https://www.cnblogs.com/s648667069/p/6478559.html @Co ...

  7. Hibernate 查询数据库中的数据

    1.Criteria介绍 Criteria与Session绑定,其生命周期跟随着Session结束而结束,使用Criteria时进行查询时,每次都要于执行时期动态建立物件,并加入各种查询条件,随着Se ...

  8. 数据库中字段类型对应的C#中的数据类型

    数据库中字段类型对应C#中的数据类型: 数据库                 C#程序 int int32 text string bigint int64 binary System.Byte[] ...

  9. 【网络收集】数据库中字段类型对应C#中的数据类型

    数据库中字段类型对应C#中的数据类型: 数据库 C#程序 int int32 text string bigint int64 binary System.Byte[] bit Boolean cha ...

随机推荐

  1. 【nodejs】初识 NodeJS(二)

    上一节我们构建了一个基础的 http 服务器,我们可以接收 http 请求,但是我们得做点什么吧 – 不同的 http 请求,服务器应该有不同的响应. 路由模块 处理不同的 http 请求在我们的代码 ...

  2. PHP正则提取或替换img标记属性

    <?php   /*PHP正则提取图片img标记中的任意属性*/ $str = '<center><img src="/uploads/images/20100516 ...

  3. .NET Core Session的使用方法

    刚使用.NET Core会不习惯,比如如何使用Session:不仅需要引用相应的类库,还需要在Startup.cs里进行注册. 1.在你的项目上基于NuGet添加: install-package M ...

  4. GeForce GTX 1080 ti安装记录

    安装GeForce GTX 1080ti 安装GeForce GTX 1080ti,8+8pin需要全接,接4pin就开机显示器上会提示电源线没接完,将显示器线接在显卡上. 设置Win 10 pro ...

  5. [译] 理解 LSTM(Long Short-Term Memory, LSTM) 网络

    本文译自 Christopher Olah 的博文 Recurrent Neural Networks 人类并不是每时每刻都从一片空白的大脑开始他们的思考.在你阅读这篇文章时候,你都是基于自己已经拥有 ...

  6. C# 3个延时函数

    ) { int time = Environment.TickCount; while (true) { if (Environment.TickCount - time >= DelayTim ...

  7. Github恶搞之自定义你的contribution图表

    在正式写程序之前让我先来看看效果: 对了,这个程序的效果就是生成一个具有你想要的“contributions in the last year”图表的html页面. 当然,html文件,而不是你在Gi ...

  8. Golang 代码检查工具

    需要先安装 gometalinter工具 #!/bin/bash #should install #go get github.com/alecthomas/gometalinter #gometal ...

  9. 用svg绘制圣诞帽

    今天是圣诞节,无意中看到csdn博客上面给我的头像带了个圣诞帽,比较好奇,想看看csdn是怎么实现的,果然用的是svg实现,不过代码有点冗长. <html> <body> &l ...

  10. linux安装jdk和tomcat命令

    1.linux centos6.5 安装jdk1.在/usr/local/src目录下,创建java文件夹,拷贝jdk安装包到/usr/local/src/java下面:cd /usr/local/s ...