Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
3 replies
Subscribers
7 subscribers
Views
1916 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
I should create a one to many relation between to tables: Flow Table and Track T
patrickp
over 10 years ago
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
0
PhilB
A Score Level 1
over 10 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
PhilB
A Score Level 1
over 10 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data