Skip to content

Commit

Permalink
SYMMETRICDS-436
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 13, 2011
1 parent 0895c7f commit 6789107
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Expand Up @@ -178,6 +178,8 @@ private ParameterConstants() {
public final static String STATISTIC_RECORD_ENABLE = "statistic.record.enable";

public final static String STORES_UPPERCASE_NAMES_IN_CATALOG = "stores.uppercase.names.in.catalog";

public final static String DB_MASTER_COLLATION = "db.master.collation";

public static Map<String, ParameterMetaData> getParameterMetaData() {
return parameterMetaData;
Expand Down
Expand Up @@ -1548,5 +1548,9 @@ public String massageForLob(String sql, Channel channel) {

public boolean escapesTemplatesForDatabaseInserts() {
return false;
}

public String getMasterCollation() {
return parameterService.getString(ParameterConstants.DB_MASTER_COLLATION, "");
}
}
Expand Down
Expand Up @@ -304,5 +304,7 @@ public long insertWithGeneratedKey(JdbcTemplate jdbcTemplate, final String sql,
* @return
*/
public boolean escapesTemplatesForDatabaseInserts();

public String getMasterCollation();

}
Expand Down
Expand Up @@ -528,6 +528,8 @@ private ColumnString buildColumnString(String origTableAlias, String tableAlias,
String formattedColumnText = AppUtils.replace("columnName", String.format("%s%s", columnPrefix, column
.getName()), templateToUse);

formattedColumnText = AppUtils.replace("masterCollation", dbDialect.getMasterCollation(), formattedColumnText);

if (isLob) {
formattedColumnText = dbDialect.massageForLob(formattedColumnText, channel);
}
Expand Down
Expand Up @@ -26,9 +26,7 @@
import org.springframework.beans.factory.FactoryBean;

/**
* Used to protect database user and password from casual observation in the properties file
*
*
* Used to protect database user and password from casual observation in the properties file
*/
public class PasswordFactory implements FactoryBean<String> {

Expand Down
Expand Up @@ -9,7 +9,7 @@
<bean id="msSqlStringTemplate" class="java.lang.String">
<constructor-arg>
<value>
<![CDATA[ case when $(tableAlias)."$(columnName)" is null then '' else '"' + replace(replace($(tableAlias)."$(columnName)",'\','\\'),'"','\"') + '"' end ]]>
<![CDATA[ case when $(tableAlias)."$(columnName)" is null then '' else '"' + replace(replace($(tableAlias)."$(columnName)" $(masterCollation),'\','\\'),'"','\"') + '"' end ]]>
</value>
</constructor-arg>
</bean>
Expand Down

0 comments on commit 6789107

Please sign in to comment.