protected String toCamelCase(String str) {
        boolean toLower = str.toUpperCase().equals(str);
        StringBuilder builder = new StringBuilder(str.length());
        for (int i = 0; i < str.length(); i++) {
            if (i < str.length() - 1 && (str.charAt(i) == '_' || str.charAt(i) == ' ')) {
                i += 1;
                if (i < str.length()) {
                    builder.append(Character.toUpperCase(str.charAt(i)));
                }
            } else if (toLower) {
                builder.append(Character.toLowerCase(str.charAt(i)));
            } else {
                builder.append(str.charAt(i));
            }
        }
        return builder.toString();
    }
{@code DefaultNamingStrategy} is the default implementation of the {@link NamingStrategy}
interface. It changes underscore usage into camel case form.

@author tiwe
querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/DefaultNamingStrategy.java