fix bug spring (h2 version + value var dans ReponseCourte)
This commit is contained in:
@@ -12,7 +12,6 @@ import lombok.Setter;
|
||||
@NoArgsConstructor
|
||||
@PrimaryKeyJoinColumn(name = "RC_Id")
|
||||
public class ReponseCourte extends Reponse{
|
||||
String value;
|
||||
|
||||
@Override
|
||||
public String valHTML(){
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@@ -15,6 +16,7 @@ import sample.data.jpa.service.QuestionDao;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/question")
|
||||
public class QuestionController {
|
||||
@Autowired
|
||||
private QuestionDao qDao;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import sample.data.jpa.metier.ReponseCourte;
|
||||
import sample.data.jpa.service.ReponseDao;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/RepCourte")
|
||||
public class ReponseController {
|
||||
private ReponseDao rDao;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user