第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

insert時(shí)沒(méi)有生成id

????@Test
????public?void?insert(){
????????User?user?=?new?User();
????????user.setName("tom");
????????user.setManagerId(1088248166370832385L);
????????user.setCreateTime(new?Date());
????????int?insert?=?userMapper.insert(user);
????????System.out.println("insert?=?"?+?insert);
????}

org.springframework.dao.DataIntegrityViolationException:?

### Error updating database.? Cause: java.sql.SQLException: Field 'id' doesn't have a default value

### The error may exist in com/exam/demo/mapper/UserMapper.java (best guess)

### The error may involve com.exam.demo.mapper.UserMapper.insert-Inline

### The error occurred while setting parameters

### SQL: INSERT INTO user? ( name,? ?manager_id, create_time )? VALUES? ( ?,? ??, ? )

### Cause: java.sql.SQLException: Field 'id' doesn't have a default value

; Field 'id' doesn't have a default value; nested exception is java.sql.SQLException: Field 'id' doesn't have a default value


正在回答

1 回答

同學(xué),你主鍵策略設(shè)置的是什么?包括mp和數(shù)據(jù)庫(kù)的,我懷疑你mp設(shè)置的為自增,但數(shù)據(jù)庫(kù)沒(méi)設(shè)置。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

insert時(shí)沒(méi)有生成id

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)