private void configureAssociation(
     GrailsDomainClassProperty grailsDomainClassProperty, final Association association) {
   association.setAssociatedEntity(
       getMappingContext()
           .addPersistentEntity(grailsDomainClassProperty.getReferencedPropertyType()));
   association.setOwningSide(grailsDomainClassProperty.isOwningSide());
   String referencedPropertyName = grailsDomainClassProperty.getReferencedPropertyName();
   if (referencedPropertyName != null) {
     association.setReferencedPropertyName(referencedPropertyName);
   } else {
     GrailsDomainClassProperty otherSide = grailsDomainClassProperty.getOtherSide();
     if (otherSide != null) {
       association.setReferencedPropertyName(otherSide.getName());
     }
   }
 }