- 使用的时候注意方法的命名规则;
-
//查询 //nativeQuery = true 允许使用原始的sql语句 @Query(value = "SELECT * FROM xx WHERE xx = xx,nativeQuery = true)
-
//增删该的时候加上@Modifying注解 @Modifying @Query(value = "update xx set xx=xx where xx = ?" , nativeQuery = true)
- 数据库的 null+1 为null;
- javax.persistence.TransactionRequiredException: Executing an update/delete query异常:需要添加事务注解@Transactional