Does Grails / GORM permit relationships in separate java packages?
<p>Grails 3 application -- I've been having trouble with a hasMany property in Grails not populating. I just realized that the owning class is in a different package from the owned class. Am I doing something silly by relating across package boundaries?</p>

<p>Basic example of what I'm doing and observing, in case that doesn't make sense:</p>

<p>Owning Domain Class:</p>

<pre><code>package com.example.project

import com.example.project.configuration.ConfigFile

class MotherClass {
    String name
    static hasMany = [ configFiles: ConfigFile ]
}
</code></pre>

<p>Owned Domain Class:</p>

<pre><code>package com.example.project.configuration

import com.example.project.*

class ConfigFile {
    String name
    MotherClass motherClass
}
</code></pre>

<p>In Bootstrap.groovy:</p>

<pre><code>MotherClass motherClass = new MotherClass(name:"mother").save(failOnError: true)
new ConfigFile(name: "file1", motherClass: mother).save(failOnError: true)
new ConfigFile(name: "file1", motherClass: mother).save(failOnError: true)
assert motherClass.configFiles.size() &gt; 0 #this assertion would fail
</code></pre>

<p>In a random service:</p>

<pre><code>assert MotherClass.findByName("mother").configFiles.size() &gt; 0 #this would fail too.
</code></pre>

<p>My assertion fails may be caused by some other issue I'm experiencing, but I wanted to verify that crossing package boundaries wasn't to blame.</p>