Exemplo n.º 1
0
  @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"));
  }
Exemplo n.º 2
0
 static String convertPropertyNameToColumnName(String propertyName, boolean toUpperCase) {
   ColumnNamingStrategy columnNamingStrategy = new ColumnNamingStrategy();
   columnNamingStrategy.setUppercase(toUpperCase);
   return columnNamingStrategy.convertPropertyNameToColumnName(propertyName);
 }
Exemplo n.º 3
0
 static String convertColumnNameToPropertyName(String columnName) {
   ColumnNamingStrategy columnNamingStrategy = new ColumnNamingStrategy();
   return columnNamingStrategy.convertColumnNameToPropertyName(columnName);
 }
Exemplo n.º 4
0
  @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"));
  }