See I dont want any mapping but what I want is just a simple thing that is....
I have two Entity
- Tasks(taskid,taskname.....,userId)
- User_Credentials(userId,password)
So What I want is userId of User Credentials used as a foreign key in Task table.
So when I fire an api to save the task I have to also pass the all details of user Credentials That I dont want.
{
"taskName": "Test",
"taskStatus": "Open",
"taskDueDate": "2022-04-15",
"taskCreatedDate": "2022-04-10",
"taskDescription": "Demo",
"taskPriority": "High",
"isTaskActive": "Yes",
"userCredentials":{
"associateId":"108",
"password":"something@9122"
}
}
What I want is
{
"taskName": "Test",
"taskStatus": "Open",
"taskDueDate": "2022-04-15",
"taskCreatedDate": "2022-04-10",
"taskDescription": "Demo",
"taskPriority": "High",
"isTaskActive": "Yes",
"userCredentials":"108"
}
That I want to post and if userCredentials id 108 is not in User Credentials Table so it pop up an error and if it is there it will save just like a foreign key concept.
So please tell me ho to do that.