A
A
Alexander Batula2019-10-14 21:03:04
PostgreSQL
Alexander Batula, 2019-10-14 21:03:04

How to link a table where its pk key is a composite of the pk of the external table and the field of the table itself??

Good afternoon! I am writing to all those who are not indifferent as a call for help. I spent the whole day!

{
  "Company": "Bohsc",
   "id": "String"
  "address": "..............",
  "timetable": "12",
  "parameters": {
    "name" : "ttttt"
    "item": [
        name: "String"
       type: "String"
      ]
    }
}

1) There is a Json file with two entities Company and Parameters - I need to display this as a @OneToOne relationship - where id - Company is part of a composite key for the Parameters table
2) And is a link as a foreign key to id Сompany Thank you all in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alexandrov, 2019-10-14
@jamakasi666

We are here first of all to help in solving a problem that has already arisen, but here it is rather a bare request to solve the problem. Where are your efforts? Where is the crux of the problem based on your trial and error?
There is a brilliant saying, although I don’t remember it verbatim, but I remember the meaning of “Try to explain to the monkey the essence of the problem and you will get an answer to your question,” something like this. So why am I, first try to explain the question to yourself, take a piece of paper and write on it what you have and how you want, even with a text, even with a diagram, try to explain the essence of the girl / wife / child / brother / friend live. I am sure that the answer will come by itself, so if for some reason it doesn’t even dawn on you, then go here with the results of the conclusions.
No offense, but I very often see a trend that everyone is lazy and it’s much easier to run to ask for an answer, instead of at least a little bit straining your brains and trying to brainstorm from different angles. And what happens if you suddenly find yourself without the Internet and without experienced minds around and there will be nowhere to ask?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question