I have four components in my large project that I'm working on...
- Existing JPA/Hibernate java library (java domain).
- Existing service layer that works with the java domain.
- Java class library of only basic interfaces (api and meta-data).
- New grails project
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.
An example...
Interface example in the api library...
public interface IPerson{
public Object getId()
public String getName()
}
Grails domain class...
class Person implements IPerson{
...
def getId(){
return id
}
String getName(){
return name;
}
}
My project works fine without the interface on the grails domain class but as soon as I add it, it seems to not be identified as an entity. I get errors like
groovy.lang.MissingMethodException: No signature of method: static com.some.thing.Person.getAll() is applicable for argument types: () values: []
Has anyone ever tried something like this?
id
andname
inPerson
? I don't know if they are omitted in listing or not. – Artur Nowak