Skip to content

Commit 009b8d8

Browse files
committed
fix for GRAILS-5156 and GRAILS-5158
1 parent 0d38dce commit 009b8d8

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,11 @@ class ClosureEventTriggeringInterceptor extends SaveOrUpdateEventListener implem
137137
event.getState()[ArrayUtils.indexOf(event.persister.propertyNames, GrailsDomainClassProperty.LAST_UPDATED)] = now;
138138
entity."$property.name" = now
139139
}
140+
if(!entity.validate(deepValidate:false)) {
141+
result = true
142+
}
140143
}
141144

142-
143-
if(!entity.validate(deepValidate:false)) {
144-
result = true
145-
}
146145
return result
147146
}
148147

src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsAnnotationConfiguration.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,23 @@ public SessionFactory buildSessionFactory() throws HibernateException {
9999
* domain classes
100100
*/
101101
protected void secondPassCompile() throws MappingException {
102-
if (configLocked) {
103-
return;
104-
}
105-
if(LOG.isDebugEnabled()) {
106-
LOG.debug("[GrailsAnnotationConfiguration] [" + this.domainClasses.size() + "] Grails domain classes to bind to persistence runtime");
107-
}
102+
if (!configLocked) {
103+
if(LOG.isDebugEnabled()) {
104+
LOG.debug("[GrailsAnnotationConfiguration] [" + this.domainClasses.size() + "] Grails domain classes to bind to persistence runtime");
105+
}
108106

109-
// do Grails class configuration
110-
for (GrailsDomainClass domainClass : this.domainClasses) {
111-
GrailsDomainBinder.evaluateMapping(domainClass);
112-
}
107+
// do Grails class configuration
108+
for (GrailsDomainClass domainClass : this.domainClasses) {
109+
GrailsDomainBinder.evaluateMapping(domainClass);
110+
}
113111

114-
// do Grails class configuration
115-
for (GrailsDomainClass domainClass : this.domainClasses) {
116-
if (LOG.isDebugEnabled()) {
117-
LOG.debug("[GrailsAnnotationConfiguration] Binding persistent class [" + domainClass.getFullName() + "]");
112+
// do Grails class configuration
113+
for (GrailsDomainClass domainClass : this.domainClasses) {
114+
if (LOG.isDebugEnabled()) {
115+
LOG.debug("[GrailsAnnotationConfiguration] Binding persistent class [" + domainClass.getFullName() + "]");
116+
}
117+
GrailsDomainBinder.bindClass(domainClass, super.createMappings());
118118
}
119-
GrailsDomainBinder.bindClass(domainClass, super.createMappings());
120119
}
121120

122121
// call super

0 commit comments

Comments
 (0)