get mapWith static domain field value from GrailsDomainClass grails

自作多情 提交于 2019-12-06 15:44:21

If you are doing a direct check on a particular domain then you can fetch the static property with domain class. In your case it would be Ticket.mapWith or Ticket.class.mapWith.

If you are doing a dynamic check then you can find it with the help of DefaultGrailsDomainClass.

GrailsDomainClass aClass = new DefaultGrailsDomainClass(clazz)
aClass.mappingStrategy

If you have the GrailsDomainClass you can access static properties via the Groovy (or Java) class using the getClazz() method or its clazz property form:

GrailsDomainClass dc = ...
String mapWith = dc.clazz.mapWith
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!