title: GORM ID generation and belongsTo association?
body: <p>I have two domains :</p>
  
  <pre><code>class CodeSetDetail {
  
    String id
    String codeSummaryId
  
    static hasMany = [codes:CodeSummary]
  
      static constraints = {
        id(unique:true,blank:false)
      }
  
      static mapping = {
        version false
        id column:'code_set_detail_id', generator: 'assigned'
      }
  }
  
  and :
  
  class CodeSummary {
  
    String id
    String codeClass
    String name
    String accession
  
    static belongsTo = [codeSetDetail:CodeSetDetail]
  
      static constraints = {
        id(unique:true,blank:false)
      }
  
      static mapping = {
        version false
        id column:'code_summary_id', generator: 'assigned'
      }
  }
  </code></pre>
  
  <p>I get two tables with columns:</p>
  
  <p><strong>code_set_detail:</strong>     </p>
  
  <pre><code>code_set_detail_id     
  code_summary_id 
  </code></pre>
  
  <p>and</p>
  
  <p><strong>code_summary:</strong>     </p>
  
  <pre><code>code_summary_id 
  code_set_detail_id (should not exist)    
  code_class    
  name   
  accession 
  </code></pre>
  
  <p>I would like to link code_set_detail table and code_summary table by 'code_summary_id' (<strong>and not by 'code_set_detail_id'</strong>).<br>
  Note : 'code_summary_id' is define as column in code_set_detail table, and define as primary key in code_summary table.</p>
  
  <p>To sum-up, I would like define 'code_summary_id' as primary key in code_summary table, and map 'code_summary_id' in code_set_detail table.</p>
  
  <p>How to define a primary key in a table, and also map this key to another table ?</p>