I am trying to do CRUD operations with My Entity bean. CRUDRepository
provide standard methods to find
, delete
and save
but there is no generic method available like saveOrUpdate(Entity entity)
that in turn calls Hibernate
or HibernateTemplate
sessions saveorUpdate()
methods.
The way CRUDRepository
provides this functionality is to
use like this
@Modifying
@Query("UPDATE Space c SET c.owner = :name WHERE c.id = :id")
Integer setNameForId(@Param("name") String name, @Param("id")
but this is not generic and needs to be written for complete form fields. Please let me know if there is any way or i can get session of Hibernate or object of Spring HibernateTemplate to solve this issue.