code: protected DependantValue createPrimaryKeyValue(InFlightMetadataCollector mappings, PersistentProperty property,
                                                     Collection collection, Map<?, ?> persistentClasses) {
          KeyValue keyValue;
          DependantValue key;
          String propertyRef = collection.getReferencedPropertyName();
          // this is to support mapping by a property
          if (propertyRef == null) {
              keyValue = collection.getOwner().getIdentifier();
          } else {
              keyValue = (KeyValue) collection.getOwner().getProperty(propertyRef).getValue();
          }
  
          if (LOG.isDebugEnabled())
              LOG.debug("[GrailsDomainBinder] creating dependant key value  to table [" + keyValue.getTable().getName() + "]");
  
          key = new DependantValue(metadataBuildingContext, collection.getCollectionTable(), keyValue);
  
          key.setTypeName(null);
          // make nullable and non-updateable
          key.setNullable(true);
          key.setUpdateable(false);
          return key;
      }
docs: Creates the DependentValue object that forms a primary key reference for the collection.
  
  @param mappings
  @param property          The grails property
  @param collection        The collection object
  @param persistentClasses
  @return The DependantValue (key)