Grails
  1. Grails
  2. GRAILS-7964

Support creating association on non primary key

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.7, 2.3
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:

      Description

      GORM does not support creating association by joining on non primary key. This is very common in SQL, and hibernate supports it too (with property-ref attribute)
      See this question http://stackoverflow.com/questions/6887862/how-do-i-create-association-by-joining-non-primary-key-column

      See this hibernate doc for property-ref

      class Contact {
      String name
      String number
      }
      
      class Message {
      String text
      String number   
      Contact contactInfo //If any
      }
      

      I need to join on Message.number = Contact.number.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            sudhir
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development