Class AssociationKey


  • public class AssociationKey
    extends java.lang.Object
    Used to uniquely identify a foreign key, so that we don't join it more than once creating circularities. Note that the table+columns refers to the association owner. These are used to help detect bi-directional associations since the Hibernate runtime metamodel (persisters) do not inherently know this information. For example, consider the Order -> Customer and Customer -> Order(s) bi-directional association; both would be mapped to the ORDER_TABLE.CUST_ID column. That is the purpose of this struct.

    Bit of a misnomer to call this an association attribute. But this follows the legacy use of AssociationKey from old JoinWalkers to denote circular join detection

    • Constructor Summary

      Constructors 
      Constructor Description
      AssociationKey​(java.lang.String table, java.lang.String[] columns)
      Create the AssociationKey.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AssociationKey

        public AssociationKey​(java.lang.String table,
                              java.lang.String[] columns)
        Create the AssociationKey.
        Parameters:
        table - The table part of the association key
        columns - The columns that define the association key
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object