title: java interface on grails domain class
body: <p>I have four components in my large project that I'm working on...</p>
  
  <ol>
  <li>Existing JPA/Hibernate java library (java domain).</li>
  <li>Existing service layer that works with the java domain.</li>
  <li>Java class library of only basic interfaces (api and meta-data).</li>
  <li>New grails project</li>
  </ol>
  
  <p>I have successfully tied most of this together except one last piece.  I have an existing servlet that takes in a interface class from the api but I can't seem to implement my interface on any of the grails domain classes. </p>
  
  <p>An example...</p>
  
  <p>Interface example in the api library...</p>
  
  <pre><code>public interface IPerson{
      public Object getId()
      public String getName()
  }
  </code></pre>
  
  <p>Grails domain class...</p>
  
  <pre><code>class Person implements IPerson{
  ...
      def getId(){
          return id
      }
  
      String getName(){
         return name;
      }
  
  }
  </code></pre>
  
  <p>My project works fine without the interface on the grails domain class but as soon as I add it, <strong>it seems to not be identified as an entity</strong>.  I get errors like </p>
  
  <pre><code>groovy.lang.MissingMethodException: No signature of method: static com.some.thing.Person.getAll() is applicable for argument types: () values: []
  </code></pre>
  
  <p>Has anyone ever tried something like this?</p>