I have a many-to-many relationship, and one direction is mandatory, like the following diagrams, conceptual model and physical model. A UserAccount has to have one or more Permission to it. When we insert a UserAccount, how can we enforce at least one Permission is assigned to it? This enforcement should be in database or in our client code? I will use Hibernate.
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?