@Test public void testColumnNameToPropertyName2() { ColumnNamingStrategy cns = new ColumnNamingStrategy(); assertEquals("foo", cns.convertColumnNameToPropertyName("FOO")); assertEquals("fooZoo", cns.convertColumnNameToPropertyName("FOO_ZOO")); cns.setSplitCamelCase(false); assertEquals("foo", cns.convertColumnNameToPropertyName("foo")); assertEquals("fooZoo", cns.convertColumnNameToPropertyName("fooZoo")); }
static String convertPropertyNameToColumnName(String propertyName, boolean toUpperCase) { ColumnNamingStrategy columnNamingStrategy = new ColumnNamingStrategy(); columnNamingStrategy.setUppercase(toUpperCase); return columnNamingStrategy.convertPropertyNameToColumnName(propertyName); }
static String convertColumnNameToPropertyName(String columnName) { ColumnNamingStrategy columnNamingStrategy = new ColumnNamingStrategy(); return columnNamingStrategy.convertColumnNameToPropertyName(columnName); }
@Test public void testPropertyNameToColumnName2() { ColumnNamingStrategy cns = new ColumnNamingStrategy(); assertEquals("FOO", cns.convertPropertyNameToColumnName("foo")); assertEquals("FOO_BOO", cns.convertPropertyNameToColumnName("fooBoo")); cns.setUppercase(false); assertEquals("foo", cns.convertPropertyNameToColumnName("foo")); assertEquals("foo_boo", cns.convertPropertyNameToColumnName("fooBoo")); cns.setSplitCamelCase(false); assertEquals("foo", cns.convertPropertyNameToColumnName("foo")); assertEquals("fooboo", cns.convertPropertyNameToColumnName("fooBoo")); assertEquals("fooboo", cns.convertPropertyNameToColumnName("FOOBOO")); cns.setChangeCase(false); assertEquals("foo", cns.convertPropertyNameToColumnName("foo")); assertEquals("fooBoo", cns.convertPropertyNameToColumnName("fooBoo")); assertEquals("FOOBOO", cns.convertPropertyNameToColumnName("FOOBOO")); }