在具有关联的多个表中插入sequelize(表具有两个多对多)

eivnm1vs  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(260)

主要实体车辆、人员、投诉
车辆和投诉之间存在着各种各样的关系。人与人之间也存在着多对多的关系
我需要编写mysql Sequalize,为上述关联创建一个方法。这是我需要插入到数据库表中的json对象,例如vehicle、people、complain、complain\u vechicle、complaine\u people

{
"violationType": "car", 
"ComplaintAccuracy": "good", 
"description": "this is about complaine",
"vehicle":[
        {
          "vehicleColor": "red",
          "vehicleNumber": "BG1234",
          "vehicleStatus": "victim",
          "vehicleType": "A"
        },
        {
          "vehicleColor": "White",
          "vehicleNumber": "RD3456",
          "vehicleStatus": "victim",
          "vehicleType": "B"
        }
        ],
"prople":[
        {
        "ageRange": "18+",
        "gender": "male",
        "personStatus": "no",
        "skinColor": "black"
        },
        {
        "ageRange": "18+",
        "gender": "male",
        "personStatus": "no",
        "skinColor": "white"
        }
        ]

}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题