前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >org.hibernate.MappingException: Could not determine type for: String, at table: Elec_SystemDDL, for

org.hibernate.MappingException: Could not determine type for: String, at table: Elec_SystemDDL, for

作者头像
qubianzhong
发布2018-09-19 13:00:09
4100
发布2018-09-19 13:00:09
举报
文章被收录于专栏:行者常至行者常至行者常至
org.hibernate.MappingException: Could not determine type for: String, at table: Elec_SystemDDL, for columns: [org.hibernate.mapping.Column(ddlName)

这个错误找了,好一会,看提示应该就是配置文件的问题
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="cn.itcast.elec.domain.ElecSystemDDl" table="Elec_SystemDDL">
        <id name="seqID" type="integer">
            <column name="seqID" not-null="true"  />
            <generator class="increment"></generator>
        </id>
        <property name="keyWord" type="string">
            <column name="Keyword" />
        </property>
        <property name="ddlCode" type="integer">
            <column name="ddlCode"/>
        </property>

        <property name="ddlName" type="String">
            <column name="ddlName" />
        </property>
    </class>
</hibernate-mapping>
看着也好像没有问题啊! ddlName 就是String 类型的呀!

细看一会,才发现,配置文件中的property 中的 type 不能形成 String 而应该是 string 。【要全部小写】

你如果把上面 ddlCode 的type = “integer” 改为 Integer 同样会报下面的错误。
org.hibernate.MappingException: Could not determine type for: Integer, at table: Elec_SystemDDL, for columns: [org.hibernate.mapping.Column(ddlCode)]
    org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:291)
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2015年08月04日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 这个错误找了,好一会,看提示应该就是配置文件的问题
  • 看着也好像没有问题啊! ddlName 就是String 类型的呀!
  • 细看一会,才发现,配置文件中的property 中的 type 不能形成 String 而应该是 string 。【要全部小写】
  • 你如果把上面 ddlCode 的type = “integer” 改为 Integer 同样会报下面的错误。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档