Monday, January 12, 2015

"Restart computer" failed when installing SQL Server 2012

“Restart computer” failed when installing SQL Server 2012


cd sql server folder

run

setup.exe /SkipRules=RebootRequiredCheck /ACTION=install



"Restart computer" failed when installing SQL Server 2012

Sunday, January 4, 2015

How to setting "Custom Naming Strategy" in grails project

How to setting “Custom Naming Strategy” in grails project


By default Grails uses Hibernate’s ImprovedNamingStrategy to convert domain class Class and field names to SQL table and column names by converting from camel-cased Strings to ones that use underscores as word separators. You can customize these on a per-class basis in the mapping closure but if there’s a consistent pattern you can specify a different NamingStrategy class to use.

Configure the class name to be used in grails-app/conf/DataSource.groovy in the hibernate section, e.g.


hibernate

cache.use_second_level_cache = true

cache.use_query_cache = false

cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'

naming_strategy = com.a5go.CustomNamingStrategy


You can use an existing class or write your own, for example one that prefixes table names and column names:

package com.a5go


import org.hibernate.cfg.ImprovedNamingStrategy

import org.hibernate.util.StringHelper


class CustomNamingStrategy extends ImprovedNamingStrategy


String classToTableName(String className)

"T_" + StringHelper.unqualify(className)




How to setting "Custom Naming Strategy" in grails project