ifree-zm opened a new issue, #14340:
URL: https://github.com/apache/grails-core/issues/14340

   with **gorm-hibernate5-spring-boot:7.3.1** 
   my code was:
   ```
   def groovyCode = """
         package com.example.gorm.entity
   
         import grails.gorm.annotation.Entity
         import org.grails.datastore.gorm.GormEntity
         
         @Entity
         class Person implements{
             String firstName
             String lastName
         }
   
         """
         def groovyClass2= loader.parseClass(groovyCode);
         def person = groovyClass.getDeclaredConstructor().newInstance()
         person.invokeMethod("find", { lastName == "John" })
   ```
   Running the above code will throw an exception:
   ```
   Either class [com.example.newgorm.entity.Person] is not a domain class or 
GORM has not been initialized correctly or has already been shutdown. Ensure 
GORM is loaded and configured correctly before calling any methods on a GORM 
entity.
   ```
   I found that domain will be registered to **STATIC_APIS** at project 
startup. Can I dynamically register Person domain now?


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