0
votes

Having a grails domain class, how to find the type of a property having its path. For example, suppose following classes:

class Contract {
    Client owner
}

class Client {
    String title
}

Following code is in a controller :

DefaultGrailsDomainClass domainClass = grailsApplication.getDomainClass("pkg.Contract")

Now having the Contract DefaultGrailsDomainClass and "owner.title", is it possible to find title's type? (Which should be String)

1

1 Answers

1
votes

The answer is too simple:

domainClass.getPropertyByName("owner.title")