ilPittiz opened a new issue, #14568:
URL: https://github.com/apache/grails-core/issues/14568

   Given the following domain classes
   ```
   class A {
       String a
       int b
       boolean c
       Set<F> fs
       Set<F> efs
   
       static embedded = [ 'efs' ]
   }
   ```
   ```
   class X {
       String x
       String y
       A z
       Set<F> fs
       Set<F> efs
   
       static embedded = [ 'efs' ]
   
       static mapping = {
           id name: 'x', generator: 'assigned'
           version false
       }
   }
   ```
   ```
   class F {
       String f
   }
   ```
   
   In Grails 3.2, to get the list of all domain class' properties:
   ```
   println new DefaultGrailsDomainClass(A.class).persistentProperties.collect { 
it.name }
   > [a, b, c, efs, fs]
   println new DefaultGrailsDomainClass(X.class).persistentProperties.collect { 
it.name }
   > [efs, fs, x, y, z]
   ```
   
   In Grails 3.3, with `GrailsDomainClass` being deprecated and replaced by 
`PersistentEntity`:
   ```
   println 
Holders.grailsApplication.mappingContext.getPersistentEntity(A.class.name)?.persistentPropertyNames
   > [c, efs, a, b, version]
   println 
Holders.grailsApplication.mappingContext.getPersistentEntity(X.class.name)?.persistentPropertyNames
   > [efs, z, version, y]
   ```
   
   Differences in Grails 3.3:
   - `x` property, mapped as id, is not listed
   - `fs` property, referencing another domain class, is not listed (while 
`efs`, declared as embedded, is included as expected)
   - `version` property showing up even with disabled versioning for `X` domain 
class
   
   ### Example application
   
   https://github.com/ilPittiz/persistentProperties
   
   Run the application and access http://localhost:8080 (Grails 3.3.5 is 
predefined).
   By editing `gradle.properties` and `MainController.groovy` you can switch 
between Grails 3.3 and 3.2, and vice-versa.
   
   ### Environment Information
   
   - **GORM Version:** 6.1.8
   - **Grails Version:** 3.3.5
   - **JDK Version:** 1.8.0_171


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to