`
maomaozgc
  • 浏览: 333826 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Null value was assigned to a property of primitive type setter of

阅读更多
Null value was assigned to a property of primitive type setter of

问题域:页面显示出错
Null value was assigned to a property of primitive type setter of com.xgb.zzgl.model.InspirationalScholar.zyrs


这个错误是因为将Integer类型写成了int类型造成的。


问题域:页面显示出错

而相关的错误还可能是配置文件的错误。
例如:
在spring文件中先开始配置的是
<prop key="hibernate.hbm2ddl.auto">update</prop>
然后在此基础上对实体类进行添加boolean 类型的属性
<property name="flag" />...
则会在页面上显示的时候报
Null value was assigned to a property of primitive type setter of 错误
则是因为hibernate只会更新实体表字段,并且给null给数据。
而在页面取出实体的时候hibernate 会自动去检测实体类中的每一个字段类型和值。
当检测到null去匹配boolean 类型的时候就会报错。即使你要的实体对象中根本就没有让
其显示该字段属性但是hibernate 还是去将每个字段值赋值给实体对象属性。这样就存在
刚才所说的null--->boolean

解决方案:
<prop key="hibernate.hbm2ddl.auto">create</prop>
重新自动建表这样Hibernate会保存java类型到数据库类型的转变信息。

分享到:
评论

相关推荐

    tfs2010 assigned To改变邮件自动转发

    标题 "TFS2010 Assigned To 改变邮件自动转发" 涉及的是Team Foundation Server (TFS) 2010中的一项功能,该功能允许在工作项(Work Item)的“分配给”(Assigned To)字段发生变化时,系统会自动向新的指派人发送...

    Visual Studio打开Qt项目时“there's no Qt version assigned to this proj

    在使用Visual Studio开发Qt应用程序的过程中,可能会遇到这样一个棘手的问题:当你尝试打开一个Qt项目时,系统会弹出错误提示“there's no Qt version assigned to this project for platform win32”。这个问题表明...

    EHLib 6.3.171〖D7~XE5〗

    This property can be assigned by a maximum time, which will be used to calculate the widths of the columns when the user double click on the line that separates columns. If the time of calculation ...

    S7A驱动720版本

    - When the signal conditioning function "S&M" was used for a byte value, the driver wrote wrong values to the PLC. Build 223 : New Functions: - The number of supported NetLinks has been ...

    Kubernetes+in+Action-Manning(2018)

    After working at Red Hat for a few years, in late 2014 I was assigned to a newly- established team called Cloud Enablement. Our task was to bring the company’s range of middleware products to the ...

    Poul Skott Stay Alive

    After his service with NASA, Lockhart was assigned to and graduated in 2004 from the Royal College of Defence Studies in London, United Kingdom. His last military assignment was with the headquarters ...

    haproxy-1.5.14.tar

    I want to address sincere congratulations to Charlie Smurthwaite of aTech Media for the really detailed traces he provided which made it possible to find the cause of this bug. Every user of 1.5-dev,...

    数位板压力测试

    This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a ...

    2009 达内Unix学习笔记

    [] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...

    Kubernetes in Action-Manning Publications (2018)

    After working at Red Hat for a few years, in late 2014 I was assigned to a newlyestablished team called Cloud Enablement. Our task was to bring the company’s range of middleware products to the ...

    servlet2.4doc

    Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server. Cookie(String, String) - Constructor for class javax....

    微软内部资料-SQL性能优化3

    Used to lock ranges between records in a table to prevent phantom insertions or deletions into a set of records. Ensures serializable transactions. RID A Row Identifier. Used to individually lock a ...

    Big.Data.and.IT.Professionals.1514870622

    Big Data and IT Professionals: A Study of the Perceptions Held by IT Professionals in Relation to the Maturity, Value, and Practical Deployment of Big Data Solutions This work documents a research ...

    TscExcelExport 3.6 full source

    - Text property of field in stead of Value property is exported so OnGetText events can be used Version 2.91 - Improvements SetFormat (before exporting data) - Added support for fieldtype ...

    Delphi7.1 Update

    * Editing the value of an InternalCalc field on a nested TClientDataset causes the ChangeCount property of the parent dataset to increase (Quality Central 2027). * A TLargeIntField cannot be used as ...

    polycom宝利通视频会议软件3.9 2018

    Subject to the terms of this Laboratory and Developer License, POLYCOM grants you a limited, non-exclusive, non-transferable license to install and use, on a DEVICE, the number and type of SOFTWARE ...

    acpi控制笔记本风扇转速

    produced when this parameter was a null string (""). Now, the original input filename is used as the AML output filename, with an ".aml" extension. Implemented a generic batch command mode for the ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Friends Exceptions Run-Time Type Information (RTTI) Casting Streams Preincrement and Predecrement Use of const Integer Types 64-bit Portability Preprocessor Macros 0 and NULL sizeof Boost C++0x ...

    Semi-Automatic 2D-to-3D Conversion Using disparity propagation

    Then, the initial disparity map is assigned to each key frame with the aid of various preset disparity models for each object. After the disparity assignment step, disparity maps for other frames of ...

Global site tag (gtag.js) - Google Analytics