Pavel Savchyk
Pavel Savchyk

Reputation: 362

Get all transient fields of class

How can i get all transient fields of domain class?

I need smth like this:

domainObject.domainClass.persistentProperties

but for transient properties.

Upvotes: 1

Views: 427

Answers (1)

doelleri
doelleri

Reputation: 19702

domainObject.domainClass.properties returns a list of DefaultGrailsDomainClassProperty. These objects have a number of properties themselves, including persistent.

You can find all transient properties with:

domainObject.domainClass.properties.findAll { !it.persistent }

Upvotes: 1

Related Questions