Skip to content

Commit 2e43aca

Browse files
committed
fix for GRAILS-6385 "Using g:select with domain class using assigned string id causes: groovy.lang.MissingPropertyException: No such property: ident for class"
1 parent d0b8666 commit 2e43aca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/java/org/codehaus/groovy/grails/orm/hibernate/proxy/GroovyAwareJavassistLazyInitializer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ public Object invoke(
212212
throw new Exception(t.getCause());
213213
}
214214
if (result == INVOKE_IMPLEMENTATION) {
215-
Object target = getImplementation();
216-
GrailsHibernateUtil.ensureCorrectGroovyMetaClass(target,persistentClass);
215+
Object target = getImplementation();
217216
final Object returnValue;
218217
try {
219218
if (ReflectHelper.isPublic(persistentClass, thisMethod)) {

src/java/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventTriggeringInterceptor.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import org.hibernate.event.*
3434
import org.springframework.beans.factory.config.AutowireCapableBeanFactory
3535
import org.springframework.context.ApplicationContext
3636
import org.springframework.context.ApplicationContextAware
37+
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsHibernateUtil
3738

3839
/**
3940
* <p>Invokes closure events on domain entities such as beforeInsert, beforeUpdate and beforeDelete.
@@ -121,7 +122,7 @@ class ClosureEventTriggeringInterceptor extends SaveOrUpdateEventListener implem
121122

122123
void onPreLoad(PreLoadEvent event) {
123124
def entity = event.getEntity()
124-
125+
GrailsHibernateUtil.ensureCorrectGroovyMetaClass(entity, entity.class );
125126
if (shouldTrigger(entity)) {
126127
if (entity.metaClass.hasProperty(entity, ONLOAD_EVENT)) {
127128
triggerEvent(ONLOAD_EVENT, event.entity, event)

0 commit comments

Comments
 (0)