private static HashMap<String,Field> buildFieldCache(Class<?> cls){
  final HashMap<String,Field> cache=new HashMap<>();
  final List<Field> fields=getAllFields(cls);
  for (  Field fld : fields) {
    String name=null;
    final Reference refAnn=fld.getAnnotation(Reference.class);
    if (refAnn != null)     name=selectColumnName(refAnn,fld);
    if (name == null) {
      final Column colAnn=fld.getAnnotation(Column.class);
      if (colAnn != null)       name=selectColumnName(colAnn,fld);
    }
    if (name == null)     continue;
    cache.put(name,fld);
  }
  return cache;
}

private static HashMap < String , Field > buildFieldCache ( Class < ? > cls ) { final HashMap < String , Field > cache = new HashMap < > ( ) ; final List < Field > fields = getAllFields ( cls ) ; for ( Field fld : fields ) { String name = null ; final Reference refAnn = fld . getAnnotation ( Reference . class ) ; if ( refAnn != null ) name = selectColumnName ( refAnn , fld ) ; if ( name == null ) { final Column colAnn = fld . getAnnotation ( Column . class ) ; if ( colAnn != null ) name = selectColumnName ( colAnn , fld ) ; } if ( name == null ) continue ; cache . put ( name , fld ) ; } return cache ; }
avoids the need to loop over fields for every column by caching them ahead of time .
