@Modifying @Query(nativeQuery = true, value = "INSERT INTO user(user_id,user_account,user_psw,user_state,user_sex,user_age,user_sign,user_img) VALUES " + "(UUID(),?1,?2,0,null,null,null,null)")
不能用插入语句怎么办???注册怎么写?
你要添加事务注解:
@Transactional
@Modifying
@Query(value="insert into jpa_person(id,name,gender,birth) values(?,?,?,?)",nativeQuery=true)
public int insertPerson2(Integer id,String name,Integer gender,Date birth);