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. C#中Json的简单处理

    命名空间:Windows.Data.Json在Windows Runtime中,可以使用Json类对获取的Json字符串进行操作,相比DataContractJsonSerializer类操作更加直观 ...

  2. SIRI课程表

    wen 周一@0@{今天没课哦}周一 周二今天共一节课 第2节,可编程控制器应用,11号教学楼1 0 3房间 周二 周三今天共三节课 第二节,过程控制系统,2号楼2 1 0房间,第三节机械制造技术11 ...

  3. Android自定义zxing扫描界面的实现

    首先,我们需要导入zxing的jar文件,其次复制所需要的资源文件以及放入自己需要添加的资源文件,复制出源码的必要相关类文件.对布局文件进行一定的修改,再修改CaptureActivity与Viewf ...

  4. The lion king 经典句型摘录

    What am I going to do with him? Everything the light touches is our kingdom. But I thought a king ca ...

  5. 8 Explicit Animations 指明的动画 笔记

    8 Explicit Animations 指明的动画 笔记     If you want something done right, do it yourself. 如果你想让事情做好,那就自动来 ...

  6. python实现: protobuf解释器

    之前项目为了自动化,所以写一个protobuf的解释器,用来生成项目所需的格式. 当然现在通过以下链接的指导,跳过手工分析,直接生成代码了. https://developers.google.com ...

  7. html文本溢出显示省略字符的两种常用方法

    方法一:使用CSS溢出省略的方式解决 解决效果如下: css代码: display: -webkit-box; display: -moz-box; white-space: pre-wrap; wo ...

  8. html5shiv.js让吃屎的IE6、IE7、IE8支持html5去吧

    插件介绍 用于解决IE9以下版本浏览器对HTML5新增标签不识别,并导致CSS不起作用的问题.所以我们在使用过程中,想要让低版本的浏览器,即IE9以下的浏览器支持,那么这款html5shiv.js是一 ...

  9. windows10家庭版 远程桌面报错

    windows10家庭版 远程桌面报错“要求的函数不受支持 ...”,Windows没有编辑组策略选项(gpedit.msc),所以无法按照微软提供的方法来修改组策略.所以我们需要修改注册表的方法来修 ...

  10. sin_addr.s_addr和sin_addr.S_un.S_addr

    sin_addr.s_addr和sin_addr.S_un.S_addr 先mark一下,等下写