/** * Enable or disable forcing field names to uppercase. * The method needs to be called in deploy stage. */ protected void updateUppercaseSetting(Map m){ //Set Native SQL flag if it was specified. String uppercaseString = EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.NATIVE_QUERY_UPPERCASE_COLUMNS, m, session); if (uppercaseString != null) { if (uppercaseString.equalsIgnoreCase("true") ){ this.session.getProject().getLogin().setShouldForceFieldNamesToUpperCase(true); } else if (uppercaseString.equalsIgnoreCase("false")) { this.session.getProject().getLogin().setShouldForceFieldNamesToUpperCase(false); } else { this.session.handleException(ValidationException.invalidBooleanValueForProperty(uppercaseString, PersistenceUnitProperties.NATIVE_QUERY_UPPERCASE_COLUMNS)); } } }
/** /** * Enable or disable forcing field names to be case insensitive. Implementation of case insensitive column handling relies on setting * both sides to uppercase (the column names from annotations/xml as well as what is returned from the JDBC/statement) * The method needs to be called in deploy stage. */ public static void updateCaseSensitivitySettings(Map m, MetadataProject project, AbstractSession session){ //Set Native SQL flag if it was specified. String insensitiveString = EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.UPPERCASE_COLUMN_NAMES, m, session); if (insensitiveString == null || insensitiveString.equalsIgnoreCase("true")) { // Set or default to case in-sensitive. project.setShouldForceFieldNamesToUpperCase(true); session.getProject().getLogin().setShouldForceFieldNamesToUpperCase(true); } else if (insensitiveString.equalsIgnoreCase("false")) { project.setShouldForceFieldNamesToUpperCase(false); session.getProject().getLogin().setShouldForceFieldNamesToUpperCase(false); } else { session.handleException(ValidationException.invalidBooleanValueForProperty(insensitiveString, PersistenceUnitProperties.UPPERCASE_COLUMN_NAMES)); } }
databaseLogin.setShouldForceFieldNamesToUpperCase(databaseLoginConfig.getForceFieldNamesToUppercase());
databaseLogin.setShouldForceFieldNamesToUpperCase(databaseLoginConfig.getForceFieldNamesToUppercase());
databaseLogin.setShouldForceFieldNamesToUpperCase(databaseLoginConfig.getForceFieldNamesToUppercase());