0

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.)

sodastream
  • 129
  • 10

1 Answers1

0

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")
Mamun Sardar
  • 2,679
  • 4
  • 36
  • 44