Disambiguate column_id
in your WHERE
clause:
where subject_id = 1 and questionType='University' and 1=1 order by rand() limit ?
I guess it is caused by this line of code:
String query = "subject_id = " + subId +" and "+ "questionType='" + questionType +"' and 1=1 order by rand()";
It should be something like
String query = "this_.subject_id = " + subId +" and "+ "this_.questionType='" + questionType +"' and 1=1 order by rand()";
manpreet
Best Answer
2 years ago
Hello Everyone I'm trying to retrive some data from my database but I'm getting
It works if I retrive some other column of same table. I'm using spring and hibernate
Here is my controller code
Here is my Service
and here is my domain
@Table(name = "question") public class Question {