I have an entity class and repository. Here I'm trying to execute update query but not working. How to update Lob column in native query or any another solution on jpa query to update Lob column.
@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 );
}
Error:
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