I should create a one to many relation between to tables: Flow Table and Track T

I should create a one to many relation between to tables: Flow Table and Track Table.
The first one, Flow, has a primary key which is made up of two columns cod_flow and cod_rec. There isn't any auto-increment id.
I would like to set 2 foreign keys, cod_flow and cod_rec, on the Track Table.
I have already tried to use some jpa annotations based on
@ManyToOne
@JoinColumns({
@JoinColumn(name="cod_flow", referencedColumnName="cod_flow"),
@JoinColumn(name="cod_rec", referencedColumnName="cod_rec")
})
but didn't work properly.
How could we configure these Primary Keys and Foreign keys into the CDTs?
Thanks in advance!

OriginalPostID-137431

OriginalPostID-137431

  Discussion posts and replies are publicly visible

Parents
  • It may not be possible if the owners of the database don't wish to do it, but you could have them build a view against the database that flattens the two tables against each other by doing the composite join for you and generates a unique ID against each row, and then map a cdt to that view. There are various options for generated keys but what is possible depends on the type of database used.
Reply
  • It may not be possible if the owners of the database don't wish to do it, but you could have them build a view against the database that flattens the two tables against each other by doing the composite join for you and generates a unique ID against each row, and then map a cdt to that view. There are various options for generated keys but what is possible depends on the type of database used.
Children
No Data