Here you can find the source of fieldToColumnName(String name)
public static String fieldToColumnName(String name)
//package com.java2s; //License from project: Open Source License public class Main { public static String fieldToColumnName(String name) { if (name == null || name.isEmpty()) { return name; }//from w w w. j a v a2 s .com StringBuffer buf = new StringBuffer(name.replace('.', '_')); for (int i = 1; i < buf.length() - 1; i++) { if ('_' != buf.charAt(i - 1) && Character.isUpperCase(buf.charAt(i)) && !Character.isUpperCase(buf.charAt(i + 1))) { buf.insert(i++, '_'); } } return buf.toString().toUpperCase(); } }