我有一个实体类和存储库。在这里,我正在尝试执行更新查询但不工作。如何更新本机查询中的 Lob 列或 jpa 查询的任何其他解决方案以更新 Lob 列。
@Entity
@Table(name = "comment")
public class Comment implements Serializable {
@Basic
@Lob
@Column(name="Article_COMMENT", columnDefinition="TEXT")
private String articleComment;
@Basic
@Column(name = "ID_ARTICLE")
private Long articleId;
}
@Repository
public interface commentRepository extends JpaRepository<Comment, Long> {
@Query(value = "UPDATE comment set articleComment=: articleComment WHERE articleId =: articleId", nativeQuery=true)
void updateComment(@Param("articleComment") String articleComment, @Param("articleId") Long articleId );
}
错误:
No results were returned by query.
JpaSystemException thrown with message: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet