Web サービスに休止状態を使用しています。
すべてのレコードを一覧表示できますが、1 つだけを取得することはできません。
表には次のものが含まれます。
ID (VARCHAR) VALUE(BIT)
celiac 1
rate 1
suggestions 0
表示されるエラーは次のとおりです。
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.pfc.restaurante.models.Device#id="xxxxxx"]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
そしてメインコード:
@JsonAutoDetect
@Entity
@Table(name = "SETTINGS")
public class Settings implements Serializable{
@Id
@Column(name="ID")
private String id;
@Column(name="VALUE", nullable=false)
private boolean value;
(...)
}
//////////////////7
@Controller
@RequestMapping("/settingsService")
public class SettingsServiceController {
@Autowired
SettingsService settingsService;
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public @ResponseBody Settings find(@PathVariable("id") String id){
return settingsService.find(id);
}
(...)
}
DBが私のエンティティと一致していないことが原因である可能性があることを読んだことがありますが(そうすべきでない場合はnullable = true)、すでに確認しましたが、そのようなことはありません。
誰か手を貸してくれませんか?
前もって感謝します!