Class::getDeclaredFields does the job. Once it is compiled by the oracle's javac 7 and run by oracle's jvm 7 you will get the result, but I don't think you are guaranteed to get it tomorrow:
"The elements in the array returned are not sorted and are not in any particular order".
class MyDomainClass {
String name
String hobby
int age
}
MyDomainClass.class.getDeclaredFields().each { println it.name }
Output:
name
hobby
age
$staticClassInfo
__$stMC
Anyway that's all not too good. One could use annotations supplying the ordering information.