Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to persist such data in mysql
    primarykey
    data
    text
    <p>I have the following 5 classes [other attributes and methods have been skipped]</p> <p><strong>CommonInterface.java</strong></p> <pre><code> import java.util.Vector; public class CommonInterface { public Vector myDescription; public Vector myPartyPlaceThing; public Vector myRole; public Vector myMomentInterval; } </code></pre> <p><strong>Description.java</strong></p> <pre><code> import java.util.Vector; public class Description { public Vector myPartyPlaceThing; public Vector myCommonInterface; } </code></pre> <p><strong>PartyPlaceThing.java</strong></p> <pre><code> import java.util.Vector; public class PartyPlaceThing { public Vector myRole; public Description myDescription; public Vector myCommonInterface; } </code></pre> <p><strong>Role.java</strong></p> <pre><code> import java.util.Vector; public class Role { public Vector myMomentInterval; public PartyPlaceThing myPartyPlaceThing; public Vector myCommonInterface; } </code></pre> <p><strong>MomentInterval.java</strong></p> <pre><code> import java.util.Vector; public class MomentInterval { public Role myRole; public Vector myMIDetail; public Vector myCommonInterface; } </code></pre> <p><strong>MIDetail.java</strong></p> <pre><code> public class MIDetail { public MomentInterval myMomentInterval; } </code></pre> <p>Now I want to persist the data in these classes in a database [mysql] where "<strong>tableName in DB == className in java</strong>"</p> <p>I know that such attributes will be included as foreign keys but the <strong>problem</strong> is how will the tables basically be created?</p> <p><strong>e.g</strong> the table description would contain partyplacething as foreign key. This means that table of partyplacething <strong>must</strong> exist before table of description can be created. similar is the case with other classes thus creating a deadlock cuz I need tables of "role and description" before I can create partyplacething and so on. the only table that I can successfully create is of MIDetail (right now cuz it is independent).</p> <p><strong>How should I change my model so that my original relationships are maintained and I can successfully persist data in a database???</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload