fix bug spring (h2 version + value var dans ReponseCourte)

This commit is contained in:
trochas
2025-10-11 13:51:53 +02:00
parent 09444a94ed
commit 57d58f5b27
157 changed files with 163 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
package sample.data.jpa.web;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -9,6 +11,7 @@ import sample.data.jpa.metier.Quizz;
import sample.data.jpa.service.QuizzDao;
@Controller
@RequestMapping("/quizz")
public class QuizzController {
private QuizzDao qDao;
@@ -69,4 +72,22 @@ public class QuizzController {
return "Question remove from Quizz " + id;
}
@RequestMapping("/getAll")
@ResponseBody
public String getAll(){
String res = "";
try {
List<Quizz> quizzs = qDao.findAll();
for (Quizz quizz : quizzs) {
res+=quizz.getId() + " nbQuestion:" + quizz.getQuestions().size() + " \n";
}
}
catch (Exception ex) {
return "Error get all Quizz :" + ex.toString();
}
return "Quizz : \n" + res;
}
}