title: many-to-many mandatory relationship enforce mandatory value
body: <p>I have a <strong>many-to-many</strong> relationship, and one direction is <strong>mandatory</strong>, like the following diagrams, conceptual model and physical model. A <strong>UserAccount</strong> has to have one or more <strong>Permission</strong> to it. When we insert a <strong>UserAccount</strong>, how can we <strong>enforce</strong> at least one Permission is assigned to it? This enforcement should be <strong>in database</strong> or in our <strong>client code</strong>? I will use <strong>Hibernate</strong>.</p>
  
  <p>I am using PowerDesigner for this modeling and it generated the database sql for me and it looks like there is no such constraint for insert. If PowerDesigner can help, how to do it?</p>
  
  <p><img src="https://i.stack.imgur.com/ZiSI2.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/HsePv.jpg" alt="enter image description here"></p>