// firstName => FIRST_NAME private static String attrNameToColumnName(String attName) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < attName.length(); i++) { char c = attName.charAt(i); if (!(c <= 'z' && c >= 'a')) { sb.append("_"); } sb.append(c); } return sb.toString().toUpperCase(); } //FIRST_NAME => firstName private static String columnNameToAttrName(String attrName) { String capitalized = WordUtils.capitalize(attrName.toLowerCase(), new char[] { '_' }); String lineRemoved = StringUtils.remove(capitalized, "_"); return StringUtils.uncapitalize(lineRemoved); }