【发布时间】:2018-01-29 13:07:30
【问题描述】:
我进行了以下替换以将我的应用程序和插件升级到 grails 3.3。 (变量名称更改是为了提高替换的清晰度。)
Grails 3.2:
Class<?> clazz = grailsDomainClass.clazz
...
def grailsDomainClass = new DefaultGrailsDomainClass(clazz)
...
GrailsDomainClassProperty[] properties = grailsDomainClass.properties
...
def propertyName = grailsDomainClass.propertyName
...
def referenceType = grailsDomainClassProperty.referencedPropertyType
...
Grails 3.3:
Class<?> clazz = persistentEntity.javaClass
...
def persistentEntity = grailsApplication.mappingContext.getPersistentEntity(DomainClass.class.name)
...
PersistentProperty[] properties = persistentEntity.persistentProperties
...
def propertyName = persistentEntity.decapitalizedName
...
def referenceType = persistentProperty.type
其他更改位于Grails 3.3 man。
女巫不清楚是:
-
什么是替代品:
grailsDomainClass.getPropertyValue(propertyName) 我应该将
doWithSpring中的代码放在我的插件上的什么位置?
手册页说:
解决方案是将在上下文可用之前执行的任何逻辑移动到在上下文可用之后执行的其他地方。
其他地方?有doWithContext 关闭吗?可以用来注入bean吗?
【问题讨论】:
标签: grails grails-plugin grails-3.3