【发布时间】:2013-04-28 20:33:41
【问题描述】:
我有一个关于 Spring beans 和 JPA 的问题
我有一个实体 A 它具有 Embeddable 类 B 作为参数之一。 B 将 Embeddable 类 C 作为其参数之一。
我的问题是:我可以将 C 用作可嵌入类和 spring bean 吗?例如。我可以做类似的事情吗
@RequestMapping(value = "game/nextQuestion/answer/{userAnswer}", method = RequestMethod.POST)
@ResponseBody
public final Question answer(
@PathVariable("userAnswer") final Long userAnswer,
@RequestBody final QuestionDetails details,
@ModelAttribute("game") GameObject game, Model m)
throws GameNotFoundException {
return model.answer(userAnswer, game, m,details);
}
在上面的示例中,QuestionDetails 是嵌入在“B”中的“C”类,它嵌入在“A”中 问题是“A”类
谢谢!
橡木
【问题讨论】: