MySQL veri tabanına bir select atıp veri çekmeye çalışyorum. Ancak sürekli aynı hatayı alıyorum . Sorun ne olabilr?
Rowid yapıp , başta 1,2,3 4 diye otomatik sayı getirmeye çalışyorum. Entity class ise ;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long calorieId;
private long userId;
private Date activityDate;
private BigDecimal activityCalorie;
org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException:
Space is not allowed after parameter prefix ':'
@Query(value = "SELECT
(SELECT @rownum := @rownum 1) as calorie_id,
'0' as activity_calorie,
'0' as activity_date,
'1' as user_id
FROM DUAL ,(SELECT @rownum := 0) r ; " , nativeQuery=true)