one to many and many to many relationship in corda
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have three tables, lets say T1, T2 and T3.
T1 is having one to many relationship with T2 and T2 and T3 are having many to many relationship between each other.
T1 state is updated to "completed" once multiple rows in T3 gets to a particular state and hence the dependent rows in T2 gets updated.
once all the rows of T2 gets to a completed state(dependent on T3) T1 state is updated to "completed".
I am trying to do one to many and many to many relationship between the tables but getting multiple errors.
can you suggest a correct design pattern from corda point of view?
corda
add a comment |
I have three tables, lets say T1, T2 and T3.
T1 is having one to many relationship with T2 and T2 and T3 are having many to many relationship between each other.
T1 state is updated to "completed" once multiple rows in T3 gets to a particular state and hence the dependent rows in T2 gets updated.
once all the rows of T2 gets to a completed state(dependent on T3) T1 state is updated to "completed".
I am trying to do one to many and many to many relationship between the tables but getting multiple errors.
can you suggest a correct design pattern from corda point of view?
corda
add a comment |
I have three tables, lets say T1, T2 and T3.
T1 is having one to many relationship with T2 and T2 and T3 are having many to many relationship between each other.
T1 state is updated to "completed" once multiple rows in T3 gets to a particular state and hence the dependent rows in T2 gets updated.
once all the rows of T2 gets to a completed state(dependent on T3) T1 state is updated to "completed".
I am trying to do one to many and many to many relationship between the tables but getting multiple errors.
can you suggest a correct design pattern from corda point of view?
corda
I have three tables, lets say T1, T2 and T3.
T1 is having one to many relationship with T2 and T2 and T3 are having many to many relationship between each other.
T1 state is updated to "completed" once multiple rows in T3 gets to a particular state and hence the dependent rows in T2 gets updated.
once all the rows of T2 gets to a completed state(dependent on T3) T1 state is updated to "completed".
I am trying to do one to many and many to many relationship between the tables but getting multiple errors.
can you suggest a correct design pattern from corda point of view?
corda
corda
asked Jan 4 at 10:33
ketykety
437
437
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are no right or wrong design here. We have tried different approaches, and different designs excel in some situations but fail miserably at others, and vice versa.
What I can advise is it depends on what your T2 or T3 is.
- If T2/T3 correspond to documents/assets in the real world and has a parent/child relationship to T1/each other, then it's better to model them as such in the form of states and link them by
linearId
orlinearPointer
(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link
- If T2/T3 are objects i.e
listOfApprovers
,listOfAttachments
,listOfCompletedStatus
, then it's preferable to let them be aList
object within the parent state itself. And do aOneToMany
annotation using JPA in the schema. link
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54037226%2fone-to-many-and-many-to-many-relationship-in-corda%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are no right or wrong design here. We have tried different approaches, and different designs excel in some situations but fail miserably at others, and vice versa.
What I can advise is it depends on what your T2 or T3 is.
- If T2/T3 correspond to documents/assets in the real world and has a parent/child relationship to T1/each other, then it's better to model them as such in the form of states and link them by
linearId
orlinearPointer
(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link
- If T2/T3 are objects i.e
listOfApprovers
,listOfAttachments
,listOfCompletedStatus
, then it's preferable to let them be aList
object within the parent state itself. And do aOneToMany
annotation using JPA in the schema. link
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
add a comment |
There are no right or wrong design here. We have tried different approaches, and different designs excel in some situations but fail miserably at others, and vice versa.
What I can advise is it depends on what your T2 or T3 is.
- If T2/T3 correspond to documents/assets in the real world and has a parent/child relationship to T1/each other, then it's better to model them as such in the form of states and link them by
linearId
orlinearPointer
(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link
- If T2/T3 are objects i.e
listOfApprovers
,listOfAttachments
,listOfCompletedStatus
, then it's preferable to let them be aList
object within the parent state itself. And do aOneToMany
annotation using JPA in the schema. link
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
add a comment |
There are no right or wrong design here. We have tried different approaches, and different designs excel in some situations but fail miserably at others, and vice versa.
What I can advise is it depends on what your T2 or T3 is.
- If T2/T3 correspond to documents/assets in the real world and has a parent/child relationship to T1/each other, then it's better to model them as such in the form of states and link them by
linearId
orlinearPointer
(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link
- If T2/T3 are objects i.e
listOfApprovers
,listOfAttachments
,listOfCompletedStatus
, then it's preferable to let them be aList
object within the parent state itself. And do aOneToMany
annotation using JPA in the schema. link
There are no right or wrong design here. We have tried different approaches, and different designs excel in some situations but fail miserably at others, and vice versa.
What I can advise is it depends on what your T2 or T3 is.
- If T2/T3 correspond to documents/assets in the real world and has a parent/child relationship to T1/each other, then it's better to model them as such in the form of states and link them by
linearId
orlinearPointer
(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link
- If T2/T3 are objects i.e
listOfApprovers
,listOfAttachments
,listOfCompletedStatus
, then it's preferable to let them be aList
object within the parent state itself. And do aOneToMany
annotation using JPA in the schema. link
answered Jan 4 at 13:25
AdrianAdrian
625111
625111
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
add a comment |
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
The first option is suiting our use case., can you please help with how to link linearId?
– kety
Jan 10 at 11:54
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54037226%2fone-to-many-and-many-to-many-relationship-in-corda%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown