Monday, April 2, 2012

Grails Domain class reflection on properties

If you want to determine what the persistent fields are for a domain class at runtime using reflection, try the following:

         DefaultGrailsDomainClass dgdc = new DefaultGrailsDomainClass(clazz)
         logger.info("properties="+dgdc.getPersistentProperties())

2 comments:

  1. Great strategy! Well, for me it’s very important to know more about this. Thanks for sharing this and keep on posting.

    Maurice | Philippine web developer

    ReplyDelete
  2. I like this type of web design article i realy appreciate your thought keep it up. its so useful for me and my knowledge.
    Read More: Best Application Services Company in Jaipur
    Best Blockchain Development Company in jaipur

    ReplyDelete