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;
}







0















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?










share|improve this question





























    0















    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?










    share|improve this question

























      0












      0








      0








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 4 at 10:33









      ketykety

      437




      437
























          1 Answer
          1






          active

          oldest

          votes


















          1














          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.




          1. 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 or linearPointer(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link

          2. If T2/T3 are objects i.e listOfApprovers, listOfAttachments, listOfCompletedStatus, then it's preferable to let them be a List object within the parent state itself. And do a OneToMany annotation using JPA in the schema. link






          share|improve this answer
























          • The first option is suiting our use case., can you please help with how to link linearId?

            – kety
            Jan 10 at 11:54












          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          1














          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.




          1. 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 or linearPointer(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link

          2. If T2/T3 are objects i.e listOfApprovers, listOfAttachments, listOfCompletedStatus, then it's preferable to let them be a List object within the parent state itself. And do a OneToMany annotation using JPA in the schema. link






          share|improve this answer
























          • The first option is suiting our use case., can you please help with how to link linearId?

            – kety
            Jan 10 at 11:54
















          1














          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.




          1. 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 or linearPointer(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link

          2. If T2/T3 are objects i.e listOfApprovers, listOfAttachments, listOfCompletedStatus, then it's preferable to let them be a List object within the parent state itself. And do a OneToMany annotation using JPA in the schema. link






          share|improve this answer
























          • The first option is suiting our use case., can you please help with how to link linearId?

            – kety
            Jan 10 at 11:54














          1












          1








          1







          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.




          1. 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 or linearPointer(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link

          2. If T2/T3 are objects i.e listOfApprovers, listOfAttachments, listOfCompletedStatus, then it's preferable to let them be a List object within the parent state itself. And do a OneToMany annotation using JPA in the schema. link






          share|improve this answer













          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.




          1. 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 or linearPointer(Corda 4). And let the contract command dictate how the states should transition from one lifecycle to the other. link

          2. If T2/T3 are objects i.e listOfApprovers, listOfAttachments, listOfCompletedStatus, then it's preferable to let them be a List object within the parent state itself. And do a OneToMany annotation using JPA in the schema. link







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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




















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas