code: public static String getAutoGeneratedId(Object po) throws SecurityException, NoSuchMethodException{
  		String autoGeneratedId = "";
  		//根据注解获取自增主键字段名
  		Field[] allFields = po.getClass().getDeclaredFields();
  		for(Field f:allFields){
  			
  			if("serialVersionUID".equals(f.getName())){
  				continue;
  			}
  			
  			//获取getter方法
  			String getterName = "get" + StringUtils.capitalize(f.getName());
  			Method getter = po.getClass().getDeclaredMethod(getterName);
  			
  			Id idAnno = getter.getAnnotation(Id.class);
  			if(idAnno == null){
  				continue;
  			}
  			GeneratedValue generatedValueAnno = getter.getAnnotation(GeneratedValue.class);
  			if(generatedValueAnno == null){
  				continue;
  			}
  			
  			if(GenerationType.IDENTITY == generatedValueAnno.strategy() || GenerationType.TABLE == generatedValueAnno.strategy()){
  				autoGeneratedId = f.getName();
  				break;
  			}
  		}
  		return autoGeneratedId;
  	}
docs: 根据注解获取自增主键字段名
  如果没找到就返回空字符串
  @param po
  @return increamentIdFieldName
  @throws NoSuchMethodException
  @throws SecurityException