Attribute "not-null" must be declared for element type "property"解决办法

在hiberante中编写映射文件时语法报错,原因是xml的DTD文件头不对

这是因为我是复制了hibernate.cfg.xml的头部文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

映射的文件,应该改为mapping的头文件就行了

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

修改后,再看语法检查就不报错了!

Attribute "not-null" must be declared for element type "property"解决办法的更多相关文章

  1. Multiple annotations found at this line: - The content of element type "mapper" must match "EMPTY". - Attribute "namespace" must be declared for element type "mapper".

    今天在mybatis的mapper映射配置文件中遇到了这样的问题,困扰了我3个小时: Multiple annotations found at this line: - The content of ...

  2. Attribute "resultType" must be declared for element type "insert"或"update"

    Attribute "resultType" must be declared for element type "insert"或"update&q ...

  3. Attribute name invalid for tag form according to TLD异常解决办法_gaigai_百度空间

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  4. javascript数组、对象和Null的typeof同为object,区分解决办法

    在JS里typeof 大家用的很多,可以使对于数组.对象和Null无法区分的问题,看了看犀牛书还是有解决办法的. document.writeln(typeof "abc"); / ...

  5. Attribute "resource" must be declared for element type "mapper".

    今天在玩mybatis的时候,遇到这个奇葩问题. 最后发现,原因是 dtd文件配置错误了.错把Mapper的直接copy过来 把DOCTYPE mapper改成configuration,Mapper ...

  6. Attribute "resultType" must be declared for element type "insert".

    这是mybatis插入数据库之后出现的问题,至于为什么出现这个问题,是因为插入的时候你照抄了查询的语句,插入的时候只有id属性和parameterType属性,并没有“resultType”属性,要注 ...

  7. Attribute "resultType" must be declared for element type "update" or "insert"

    仔细查看错误如图所示: 解决错误就是把resultType去掉,因为在insert和update语句中是没有返回值的.小坑小坑 转自:https://blog.csdn.net/u013144287/ ...

  8. 《Spring实战》-- 'cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element' 错误的解决办法

    在Eclipse中新建了一个maven项目学习Spring,在 service.xml 中配置 Spring,想要学习'面向切面的Spring',service.xml 内容如下: <beans ...

  9. 写hibernate.cfg.xml时报错The content of element type "property" must match "(meta*,(column|formula)*,type?)".

    原配置文件是这样的 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-ma ...

随机推荐

  1. 分享几个自己喜欢的前端UI框架

    http://www.layui.com/ http://element-cn.eleme.io/#/zh-CN/component/installation

  2. Elasticsearch (2) - 映射

    常用映射类型 核心的字段类型如下: String 字符串包括text和keyword两种类型: 1.text analyzer 通过analyzer属性指定分词器. 下边指定name的字段类型为tex ...

  3. rabbitmq的知识点

    rabbitmq,分为集群和主从2种. 主从式与集群式的速度差10倍. 每个rabittmq组需要3台机器. 集群式,稳定性高,主从式,速度快. 可以做任务分配,单点锁(二进制树实现). 只有当消息和 ...

  4. Devops 技术图谱

  5. Java之流水号生成器实现

    参考:https://www.jianshu.com/p/331b872e9c8f 1.建立一张存放的表 CREATE TABLE `sys_serial_number` ( `id` bigint( ...

  6. JS怎么创建一个类?

    15. JS怎么创建一个类? 方式1 : var obj = new Object(); 方式2 : var obj = {}; 16.JS的typeof返回哪些数据类型? string.number ...

  7. install docker-ce for ubuntu

    may need login vpn first docker-ce for ubuntu chinese version docker-ce for ubuntu

  8. 前端开发中的 meta 整理

    meta是html语言head区的一个辅助性标签.也许你认为这些代码可有可无.其实如果你能够用好meta标签,会给你带来意想不到的效果,meta标签的作用有:搜索引擎优化(SEO),定义页面使用语言, ...

  9. POJ-3190-分配畜栏

    这个题首先,我们需要注意的是它的时间是一秒,其中还包括了你读入数据的时间,因为cin我写的时候没有解除绑定,所以直接超时,我们直接用scanf函数读入50000组数据好了. 然后就是poj交的时候,如 ...

  10. CentOS6.8下安装Docker

    原文章链接https://www.cnblogs.com/baolong/p/5743420.html. 由于在自己安装的虚拟机上打开linux终端命令行输入uname -a 以及cat /etc/r ...