我创建了一个RESTful APIwith Spring boot并托管它Pivotal web services.
假设网址为https://abc.cfapps.io/students,json结果为
[
{"id":1,"name":"Michael","score":8.5},
{"id":2,"name":"Naomi","score":5.6}
]
Run Code Online (Sandbox Code Playgroud)
然后我写一个Angular客户端向该url发送请求:
angular.module("app", []).controller("listController", function($scope, $http)
{
var url = 'https://abc.cfapps.io/students';
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', url, true);
httpRequest.setRequestHeader('Access-Control-Allow-Origin', '*');
httpRequest.setRequestHeader('Content-Type', 'application/json');
httpRequest.onerror = function (XMLHttpRequest, textStatus, errorThrown) {
console.log('failed');
console.log(JSON.stringify(XMLHttpRequest));
};
httpRequest.onload = function () {
console.log('SUCCESS!');
}
httpRequest.send();
});
Run Code Online (Sandbox Code Playgroud)
我的客户在运行localhost:52442,在我的Spring boot service我也让CORS了.
@RestController
@CrossOrigin(origins = "http://localhost:52442")
@RequestMapping(value="/students")
public class StudentService
{
@RequestMapping(value="/",method = RequestMethod.GET) …Run Code Online (Sandbox Code Playgroud) 我在下面的图片中转换弱实体D有问题

我应该这样做吗 D(A_pri_key, B_pri_key)
还是应该分开D1(A_pri_key) and D2(B_pri_key)?
我更喜欢第二种选择,因为第一种选择在转换时看起来真的像C C(A_pri_key, B_pri_key)