code: public String entityToTable(String entityName) {
          int index = entityName.lastIndexOf('.');
          if(index >= 0){
              entityName = entityName.substring(index + 1);
          }
          index = entityName.lastIndexOf('$');
          if(index >= 0){
              entityName = entityName.substring(index + 1);
          }
  
          StringBuilder sb = new StringBuilder();
  
          for(int i=0;i<entityName.length();i++){
              char c = entityName.charAt(i);
              if(c >= 'A' && c <= 'Z' && sb.length() > 0){
                  sb.append('_');
              }
              sb.append(String.valueOf(c).toUpperCase());
          }
  
          return sb.toString();
      }
docs: {@inheritDoc}