Home Grails 3.3: transient properties and GrailsDomainClassProperty
Reply: 1

Grails 3.3: transient properties and GrailsDomainClassProperty

sodastream Published in 2018-01-06 19:36:53Z

Contemplating upgrade of a plugin from Grails 3.2.11 to Grails 3.3.2 while accomodating the slashing change in the domain class API. PersistentProperty replaces GrailsDomainClassProperty but has no isPersistent() method.

How do I find out programmatically if a domain class property is transient? Does PersistentEntity return transient properties at all?

(I tend to use transient properties a lot. Great for productivity.)

Mamun Sardar
Mamun Sardar Reply to 2018-01-08 04:27:07Z

PersistentEntity.getPersistentProperties() will give you list of properties to be persisted - meaning it doesn't include transient properties. You can try:

GrailsClassUtils.getStaticPropertyValue(MyDomain, "transients")?.contains("myPropertyName")
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320952 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO