plugins { jpa { 'demo' { //note: in future version, demo will be disabled by default //disable = false } /** * if not disabled, * - the JpaFilter will attempt to read the session.'locale' for the user's locale (if session is not existed, it * won't create one), or use the defaultLocale to set a validator at ValidatorContextHolder */ 'validator' { //disable = true; //disable any validator related features messageBundleName = 'validator' //do not start with '/' //defaultLocale = Locale.CHINESE //sessionLocaleName = 'locale' //default to session.'locale' if not specified } /** * Notice that the structure of the following definition is very similar to persistence.xml but not exactly the * same. 'class' is reserved word in ConfigSurplur and cannot be used. */ 'persistenceUnits' { /*'inmemoryDb' { //this example put everything in persistence.xml, without using dataSource 'persistenceUnit' { provider = 'org.hibernate.ejb.HibernatePersistence' //default classes = ['demo.jpa.*'] properties = [ 'hibernate.connection.url': 'jdbc:hsqldb:mem:inmemoryDb0', 'hibernate.connection.driver_class': 'org.hsqldb.jdbcDriver', 'hibernate.dialect': 'org.hibernate.dialect.HSQLDialect', 'hibernate.hbm2ddl.auto': 'create-drop', 'hibernate.connection.username': 'sa', 'hibernate.connection.password': ''] } 'spring' { id = 'entityManagerFactory' dataSource = false //do not use dataSource } } 'mysqlDb' { //mysql example, using dataSource 'persistenceUnit' { //for generating JPA persistence.xml transactionType = 'RESOURCE_LOCAL' provider = 'org.hibernate.ejb.HibernatePersistence' //default classes = ['demo.jpa.*'] // * and ** are supported //true //TODO not implemented //properties = ['hibernate.dialect': 'org.hibernate.dialect.MySQL5InnoDBDialect'] } 'spring' { //for creating Spring beans id = 'mysqlEMF' //if not specified, use persistence unit name dataSource = 'dataSource' //bean name of data source jpaVendorAdapter = {org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter bean -> //optional configuration data = 'MYSQL' generateDdl = 'true' } jpaProperties = ['hibernate.dialect': 'org.hibernate.dialect.MySQL5InnoDBDialect'] } }*/ } } } // locations to search for config files that get merged into the main config // config files can either be Java properties files or ConfigSlurper scripts // grails.config.locations = [ "classpath:${appName}-config.properties", // "classpath:${appName}-config.groovy", // "file:${userHome}/.grails/${appName}-config.properties", // "file:${userHome}/.grails/${appName}-config.groovy"] // if(System.properties["${appName}.config.location"]) { // grails.config.locations << "file:" + System.properties["${appName}.config.location"] // } grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format grails.mime.use.accept.header = false grails.mime.types = [html: ['text/html', 'application/xhtml+xml'], xml: ['text/xml', 'application/xml'], text: 'text/plain', js: 'text/javascript', rss: 'application/rss+xml', atom: 'application/atom+xml', css: 'text/css', csv: 'text/csv', all: '*/*', json: ['application/json', 'text/json'], form: 'application/x-www-form-urlencoded', multipartForm: 'multipart/form-data' ] // The default codec used to encode data with ${} grails.views.default.codec = "none" // none, html, base64 grails.views.gsp.encoding = "UTF-8" grails.converters.encoding = "UTF-8" // enabled native2ascii conversion of i18n properties files grails.enable.native2ascii = true // set per-environment serverURL stem for creating absolute links environments { production { grails.serverURL = "http://www.changeme.com" } } log4j = { trace 'groovy.jpa', 'org.grails.plugins.jpa', 'org.hibernate.SQL' }