1. 程式人生 > >source is null for getProperty(null, "parentId")

source is null for getProperty(null, "parentId")

其根本原因還是我們常見的:java.lang.NullPointerException

只不過該異常被Mybatils封裝了,就像Spring把常見的SqlException封裝成org.springframework.dao.XXXException一樣,解決方法如下:

1.第一種辦法在實體類中把物件New出來

public class Report{    
         private  String reportId;    
         private String  videoId;    
         private Video  video=new Video();    
}    

2.在mybatis中的sql語句進行逐層判斷

①. 錯誤的寫法


②. 正確的寫法


相關推薦

source is null for getProperty(null, "parentId")

其根本原因還是我們常見的:java.lang.NullPointerException只不過該異常被Mybatils封裝了,就像Spring把常見的SqlException封裝成org.springframework.dao.XXXException一樣,解決方法如下:1.第

MyBatis報OgnlException: source is null for getProperty(null, "id")異常

MyBatis報OgnlException: source is null for getProperty(null, “id”)異常 程式碼如下 <sql id="wher

android:Unable to add window -- token null is not for an application的解決方案

Error程式碼: new AlertDialog.Builder(getActivity().getApplicationContext()) .setTitle("No phone access permission") ****** .show(); Err

關於target is null for setProperty的問題總結

關於這種問題的幾種可能性總結下: 1. 對應的屬性沒有加get set  方法 2. 提交表單中有更多的name屬性而對應的action 或者model裡面沒有這個方法(這裡重要就包括一個圖片button  往往讓人們難以發現)如下面表示: <input ty

使用mybatis報錯:Error setting non null for parameter #4 with JdbcType TIMESTAMP

一次性報的異常主要有以下幾個: java.lang.RuntimeException: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException

Error setting null for parameter #1 with JdbcType OTHER .無效的列型別

org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType

資料庫,報錯:Error setting null for parameter #1with JdbcType OTHER.Try setting a different JdbcType for

報錯內容: Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #10 with JdbcType OTHER . Try setting a different JdbcType for

Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

拉分支配專案環境,Tomcat啟動報錯如下:   2018-11-05 16:06:49,837 WARN [org.apache.zookeeper.ClientCnxn] - Session 0x0 for server null, unexpected error, clo

python3 ValueError: source code string cannot contain null bytes

從windows系統拷貝到linux系統pycharm中時經常會多一些空字串,導致執行python指令碼報錯,“source code string cannot contain null bytes” 而pycharm中是無法察覺空字串的(哪位朋友有解決辦法,麻煩高訴我一下,不勝感激

Swagger異常:AbstractSerializableParameter : Illegal DefaultValue null for parameter type integer解決方案

文章目錄 出現問題 問題原因 解決方案 出現問題 專案中使用Swagger作為文件工具,每次開啟文件時,控制檯都會打印出如下異常。 2018-10-24 23:03:36.537 WARN 19699 ---

Error setting null for parameter #10 with JdbcType OTHER .

今天寫了一個mybatis的sql語句,每個欄位都沒有寫對應的jdbcType,印象中自己從來沒有寫過這個type。 今天竟然出現了問題,問題如下,查了資料說了,是因為如果傳入的值為null,mybatis無法匹配,所以,寫上了,問題解決。 下面的解決辦法是網路查詢的。做個記錄備忘。 適

Android8.0 適配ContentResolver解決java.lang.SecurityException: Failed to find provider null for user 0;

對於沒有適配Android8.0+的裝置在使用ContenResolver時會出現java.lang.SecurityException: Failed to find provider null for user 0; expected to find a valid Co

Checking for a null int value from a Java ResultSet

好神奇的 check 方式。 The default for ResultSet.getInt when the field value is NULL is to return 0, which is also the default value for your iVal declaration. In

Swagger異常:AbstractSerializableParameter : Illegal DefaultValue null for parameter type integer解決方案

文章目錄出現問題問題原因解決方案 出現問題 專案中使用Swagger作為文件工具,每次開啟文件時,控制檯都會打印出如下異常。 2018-10-24 23:03:36.537 WARN 19699 --- [nio-1111-exec-4] i.s.m.p.Ab

apache反向代理tomcat時x-forwarded-fornull的問題

apache 在用ProxyPass時會自動在header中設定X-Forwarded-For X-Forwarded-Host和X-Forwarded-Server (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html)

maven構建Idea工程出現For artifact {null :null:null:jar}: The groupId cannot be empty

今天在構建saiku使用mvm idea:idea命令構建專案工程時,總是在構建saiku-service專案時報錯,提示For artifact {null :null:null:jar}: The groupId cannot be empty,開始還以為是因為引用關係出

報錯信息是Error setting null for parameter #1 with JdbcType OTHER

mode term value 類型 需要 ati sca err image 報錯信息是:nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapp

數據庫表字段,DEFAULT NULL與NOT NULL DEFAULT

什麽 whether stp spa pos tab nal values com 為什麽要把字段設置成not null 呢? 1、空值是不占用空間的 2、mysql中的NULL其實是占用空間的,下面是來自於MYSQL官方的解釋 “NULL columns requi

My app status is Ready for Sale but I cannot see my app on the App Store. Why? 為什麽審核通過後 appstore中搜不到我的app

one soci orm event 什麽 live pstore follow following 這是蘋果的官方解答 The following factors could prevent your app from showing up on the App St

a start job is running for Raise network interface (5min 3s)

interface network following running editing a start job is running for Raise network interface (5min 3s)Maybe it is a workaround but I could redu