Permalink
Browse files

Merge branch '2.0.x' of github.com:grails/grails-core into 2.0.x

  • Loading branch information...
2 parents e44a0e5 + 9669e86 commit 46c31fe706eb12b545edbc4bf3a40bb65fc37ed4 @graemerocher graemerocher committed Apr 20, 2012
View
@@ -14,7 +14,8 @@ buildscript {
apply plugin: 'idea'
ext {
- grailsVersion = '2.0.3'
+ grailsVersion = '2.0.3.BUILD-SNAPSHOT'
+ isBuildSnapshot = grailsVersion.endsWith(".BUILD-SNAPSHOT")
antTraxVersion = "1.7.1"
antVersion = "1.8.2"
aspectjVersion = "1.6.10"
@@ -23,7 +24,7 @@ ext {
commonsCollectionsVersion = "3.2.1"
commonsIOVersion = "2.1"
commonsLangVersion = "2.6"
- datastoreVersion = "1.0.4.RELEASE"
+ datastoreVersion = "1.0.3.RELEASE"
gantVersion = "1.9.6"
gdocEngineVersion = "1.0.1"
groovyVersion = "1.8.6"
@@ -187,6 +188,7 @@ subprojects { project ->
signing {
sign configurations.archives
+ required { !isBuildSnapshot && gradle.taskGraph.contains(uploadPublished) }
}
uploadPublished {
View
@@ -1,4 +1,4 @@
-grails.version=2.0.3
+grails.version=2.0.3.BUILD-SNAPSHOT
# Bundlor dependency versions
bundlor.javax.persistence.version=1.0.2.GA
@@ -1328,7 +1328,7 @@ class BuildSettings extends AbstractBuildSettings {
}
servletVersion = getPropertyValue(SERVLET_VERSION, props, "2.5")
- compilerSourceLevel = getPropertyValue(COMPILER_SOURCE_LEVEL, props, null)
+ compilerSourceLevel = getPropertyValue(COMPILER_SOURCE_LEVEL, props, "1.6")
compilerTargetLevel = getPropertyValue(COMPILER_TARGET_LEVEL, props, "1.6")
if (!projectWorkDirSet) {
@@ -192,7 +192,7 @@ public Object doCall() {
};
registerDependencies(dependencyManager, compileTimeDependenciesMethod, commonsExcludingLoggingAndXmlApis, "commons-logging", "xml-apis", "commons-digester");
- String datastoreMappingVersion = "1.0.4.RELEASE";
+ String datastoreMappingVersion = "1.0.3.RELEASE";
ModuleRevisionId[] compileDependencies = {
ModuleRevisionId.newInstance("aopalliance", "aopalliance", "1.0"),
ModuleRevisionId.newInstance("com.googlecode.concurrentlinkedhashmap", "concurrentlinkedhashmap-lru", "1.2_jdk5"),
@@ -22,6 +22,7 @@
import org.codehaus.groovy.grails.commons.GrailsDomainClassProperty;
import org.codehaus.groovy.grails.orm.hibernate.cfg.DefaultGrailsDomainConfiguration;
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainConfiguration;
+import org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
@@ -223,80 +224,80 @@ public void destroy() throws HibernateException {
@Override
protected void postProcessConfiguration(Configuration config) throws HibernateException {
- if (hibernateEventListeners == null || hibernateEventListeners.getListenerMap() == null) {
- return;
- }
-
EventListeners listeners = config.getEventListeners();
- Map<String,Object> listenerMap = hibernateEventListeners.getListenerMap();
- addNewListenerToConfiguration(config, "auto-flush", AutoFlushEventListener.class,
- listeners.getAutoFlushEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "merge", MergeEventListener.class,
- listeners.getMergeEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "create", PersistEventListener.class,
- listeners.getPersistEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "create-onflush", PersistEventListener.class,
- listeners.getPersistOnFlushEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "delete", DeleteEventListener.class,
- listeners.getDeleteEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "dirty-check", DirtyCheckEventListener.class,
- listeners.getDirtyCheckEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "evict", EvictEventListener.class,
- listeners.getEvictEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "flush", FlushEventListener.class,
- listeners.getFlushEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "flush-entity", FlushEntityEventListener.class,
- listeners.getFlushEntityEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "load", LoadEventListener.class,
- listeners.getLoadEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "load-collection", InitializeCollectionEventListener.class,
- listeners.getInitializeCollectionEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "lock", LockEventListener.class,
- listeners.getLockEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "refresh", RefreshEventListener.class,
- listeners.getRefreshEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "replicate", ReplicateEventListener.class,
- listeners.getReplicateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "save-update", SaveOrUpdateEventListener.class,
- listeners.getSaveOrUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "save", SaveOrUpdateEventListener.class,
- listeners.getSaveEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "update", SaveOrUpdateEventListener.class,
- listeners.getUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-load", PreLoadEventListener.class,
- listeners.getPreLoadEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-update", PreUpdateEventListener.class,
- listeners.getPreUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-delete", PreDeleteEventListener.class,
- listeners.getPreDeleteEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-insert", PreInsertEventListener.class,
- listeners.getPreInsertEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-collection-recreate", PreCollectionRecreateEventListener.class,
- listeners.getPreCollectionRecreateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-collection-remove", PreCollectionRemoveEventListener.class,
- listeners.getPreCollectionRemoveEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "pre-collection-update", PreCollectionUpdateEventListener.class,
- listeners.getPreCollectionUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-load", PostLoadEventListener.class,
- listeners.getPostLoadEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-update", PostUpdateEventListener.class,
- listeners.getPostUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-delete", PostDeleteEventListener.class,
- listeners.getPostDeleteEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-insert", PostInsertEventListener.class,
- listeners.getPostInsertEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-commit-update", PostUpdateEventListener.class,
- listeners.getPostCommitUpdateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-commit-delete", PostDeleteEventListener.class,
- listeners.getPostCommitDeleteEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-commit-insert", PostInsertEventListener.class,
- listeners.getPostCommitInsertEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-collection-recreate", PostCollectionRecreateEventListener.class,
- listeners.getPostCollectionRecreateEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-collection-remove", PostCollectionRemoveEventListener.class,
- listeners.getPostCollectionRemoveEventListeners(), listenerMap);
- addNewListenerToConfiguration(config, "post-collection-update", PostCollectionUpdateEventListener.class,
- listeners.getPostCollectionUpdateEventListeners(), listenerMap);
+ if (hibernateEventListeners != null && hibernateEventListeners.getListenerMap() != null) {
+ Map<String,Object> listenerMap = hibernateEventListeners.getListenerMap();
+ addNewListenerToConfiguration(config, "auto-flush", AutoFlushEventListener.class,
+ listeners.getAutoFlushEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "merge", MergeEventListener.class,
+ listeners.getMergeEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "create", PersistEventListener.class,
+ listeners.getPersistEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "create-onflush", PersistEventListener.class,
+ listeners.getPersistOnFlushEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "delete", DeleteEventListener.class,
+ listeners.getDeleteEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "dirty-check", DirtyCheckEventListener.class,
+ listeners.getDirtyCheckEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "evict", EvictEventListener.class,
+ listeners.getEvictEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "flush", FlushEventListener.class,
+ listeners.getFlushEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "flush-entity", FlushEntityEventListener.class,
+ listeners.getFlushEntityEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "load", LoadEventListener.class,
+ listeners.getLoadEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "load-collection", InitializeCollectionEventListener.class,
+ listeners.getInitializeCollectionEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "lock", LockEventListener.class,
+ listeners.getLockEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "refresh", RefreshEventListener.class,
+ listeners.getRefreshEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "replicate", ReplicateEventListener.class,
+ listeners.getReplicateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "save-update", SaveOrUpdateEventListener.class,
+ listeners.getSaveOrUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "save", SaveOrUpdateEventListener.class,
+ listeners.getSaveEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "update", SaveOrUpdateEventListener.class,
+ listeners.getUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-load", PreLoadEventListener.class,
+ listeners.getPreLoadEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-update", PreUpdateEventListener.class,
+ listeners.getPreUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-delete", PreDeleteEventListener.class,
+ listeners.getPreDeleteEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-insert", PreInsertEventListener.class,
+ listeners.getPreInsertEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-collection-recreate", PreCollectionRecreateEventListener.class,
+ listeners.getPreCollectionRecreateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-collection-remove", PreCollectionRemoveEventListener.class,
+ listeners.getPreCollectionRemoveEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "pre-collection-update", PreCollectionUpdateEventListener.class,
+ listeners.getPreCollectionUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-load", PostLoadEventListener.class,
+ listeners.getPostLoadEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-update", PostUpdateEventListener.class,
+ listeners.getPostUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-delete", PostDeleteEventListener.class,
+ listeners.getPostDeleteEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-insert", PostInsertEventListener.class,
+ listeners.getPostInsertEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-commit-update", PostUpdateEventListener.class,
+ listeners.getPostCommitUpdateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-commit-delete", PostDeleteEventListener.class,
+ listeners.getPostCommitDeleteEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-commit-insert", PostInsertEventListener.class,
+ listeners.getPostCommitInsertEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-collection-recreate", PostCollectionRecreateEventListener.class,
+ listeners.getPostCollectionRecreateEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-collection-remove", PostCollectionRemoveEventListener.class,
+ listeners.getPostCollectionRemoveEventListeners(), listenerMap);
+ addNewListenerToConfiguration(config, "post-collection-update", PostCollectionUpdateEventListener.class,
+ listeners.getPostCollectionUpdateEventListeners(), listenerMap);
+ }
+ // register workaround for GRAILS-8988 (do nullability checks for inserts in last PreInsertEventListener)
+ ClosureEventTriggeringInterceptor.addNullabilityCheckerPreInsertEventListener(listeners);
}
@SuppressWarnings("unchecked")
@@ -204,14 +204,14 @@ public static void populateArgumentsForCriteria(GrailsApplication grailsApplicat
if (offset > -1) {
c.setFirstResult(offset);
}
- if (GrailsClassUtils.getBooleanFromMap(ARGUMENT_CACHE, argMap)) {
- c.setCacheable(true);
- }
if (GrailsClassUtils.getBooleanFromMap(ARGUMENT_LOCK, argMap)) {
c.setLockMode(LockMode.PESSIMISTIC_WRITE);
+ c.setCacheable(false);
}
else {
- if (argMap.get(ARGUMENT_CACHE) == null) {
+ if (argMap.containsKey(ARGUMENT_CACHE)) {
+ c.setCacheable(GrailsClassUtils.getBooleanFromMap(ARGUMENT_CACHE, argMap));
+ } else {
cacheCriteriaByMapping(targetClass, c);
}
}
@@ -182,7 +182,7 @@ else if (arguments[1] instanceof Map) {
}
private boolean useCache() {
- boolean useCache = false;
+ boolean useCache = getHibernateTemplate().isCacheQueries();
if (arguments.length > 1 && arguments[arguments.length - 1] instanceof Map) {
useCache = retrieveBoolean(arguments[arguments.length - 1], GrailsHibernateUtil.ARGUMENT_CACHE);
}
@@ -166,7 +166,7 @@ else if (value.getClass().isArray()) {
}
private boolean useCache(Object[] args) {
- boolean useCache = false;
+ boolean useCache = getHibernateTemplate().isCacheQueries();
if (args.length > 1 && args[args.length - 1] instanceof Map) {
Object param = args[args.length - 1];
String key = GrailsHibernateUtil.ARGUMENT_CACHE;
Oops, something went wrong.

0 comments on commit 46c31fe

Please sign in to comment.