question: public static String dbNameToVarName ( String columnName ) { if ( columnName == null ) return null ; StringBuilder fieldName = new StringBuilder ( columnName . length ( ) ) ; boolean toUpper = false ; for ( int i = 0 ; i < columnName . length ( ) ; i ++ ) { char ch = columnName . charAt ( i ) ; if ( ch == '_' ) { toUpper = true ; } else if ( toUpper ) { fieldName . append ( Character . toUpperCase ( ch ) ) ; toUpper = false ; } else { fieldName . append ( Character . toLowerCase ( ch ) ) ; } } return fieldName . toString ( ) ; }
target:  Converts a database name to a Java variable name. The naming conventions used to allow for this are as follows: a database name (table or column) is in all capital letters, and the words are separated by an underscore (for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all lower case letters, except the letter at the beginning of each word (for example: NeatEntityName or RandomFieldName). The convention of using a capital letter at the beginning of a class name in Java, or a lower-case letter for the beginning of a variable name in Java is also used along with the Java name convention above.