@Repository
public interface RoomRepository extends CrudRepository<RoomEntity, Long> {
@Override
List<RoomEntity> findAll();
@Modifying
@Query("INSERT INTO room VALUES(:id, :name)")
RoomEntity insert(@Param("id") String uuid, @Param("name") String name);
}
I made an insert custom query to use the default key for the UUID. Is there any way for custom queries to receive result values as entities? The above code doesn't work. The framework is returning an int.