'updateing ora_archive_state using @Query spring data

I am trying to update all the entities created befor a specific date setting the hidden field ora_archive_state which is not defined in the Entity to 1

Using spring data method

/**
 * update all the entities created before :createdDate, this method is used mainly with the archiving job.
 * @param createdDate
 * @return
 */
@Modifying(clearAutomatically = true)
@Query("update Entity entity set entity.ora_archive_state  = 1 where entity.createdDate < :createdDate")
void updateEntityByCreatedDate(@Param("createdDate") LocalDateTime createdDate);

But it throw that error during server startup

Reason: Validation failed for query for method public abstract void com.EntityJpaRepository.updateEntityByCreatedDate(java.time.LocalDateTime)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract void com.EntityJpaRepository.updateEntityByCreatedDate(java.time.LocalDateTime)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source