当前位置: 首页 > 知识库问答 >
问题:

ORA-00932:不一致的数据类型:预期得到的clob Hibernate/Springboot

陈坚
2023-03-14
select distinct score.userId as userId, sum(score.totalScore) as totalScore, 
    sum(score.timeTaken) as timeTaken, user.image as image
from Score score, User user
where score.userId = user.userId
group by score.userId order by totalScore desc, timeTaken asc
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "id_Sequence2")
@SequenceGenerator(name = "id_Sequence2", sequenceName = "ID_SEQ2")
@Column(name = "id", updatable = false, nullable = false)
int id;
int userId;
@Lob
String image;
Date createdDate;
Date lastLoggedIn;

得分:

@Id
@Column(name = "quizID", updatable = false, nullable = false)
int quizId;
@Id
@Column(name = "userID", updatable = false, nullable = false)
int userId;
double totalScore;
@OneToMany(targetEntity=UserQuizRecord.class, fetch=FetchType.EAGER, cascade = { CascadeType.ALL })
List<UserQuizRecord> userQuizRecords;
int timeTaken;
int correctAns;
Date takenDate;

共有1个答案

厍浩广
2023-03-14

检查这个链接。

https://forum.hibernate.org/viewtopic.php?f=1&t=998284

因此,distinct不能与clobdatatype(即image)一起使用。请检查这是否解决了您的问题。

 类似资料: