获得rowid

@param field rowid属性名
@return RowId
167732
public RowId getRowId(String field) {
		Object obj = this.get(field);
		if (null == obj) {
			return null;
		}
		if (obj instanceof RowId) {
			return (RowId) obj;
		}
		throw new DbRuntimeException("Value of field [{}] is not a rowid!", field);
	}
1339858
public FieldAccessor create(final Field field) {

        ArgUtils.notNull(field, "field");

        final FieldAccessor accessor = new FieldAccessor();

        // 共通情報の設定
        accessor.name = field.getName();
        accessor.targetType = field.getType();
        accessor.declaringClass = field.getDeclaringClass();

        // フィールド情報の設定
        setupWithFiled(accessor, field);

        // getter情報の設定
        if(ClassUtils.isPrimitiveBoolean(accessor.getType())) {
            ClassUtils.extractBooleanGetter(accessor.getDeclaringClass(), accessor.getName())
                    .ifPresent(getter -> setupWithGetter(accessor, getter));

        } else {
            ClassUtils.extractGetter(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                    .ifPresent(getter -> setupWithGetter(accessor, getter));
        }

        // setter情報の設定
        ClassUtils.extractSetter(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                .ifPresent(setter -> setupWithSetter(accessor, setter));

        // コンポーネントタイプの設定
        if(Collection.class.isAssignableFrom(accessor.getType())) {
            ParameterizedType type = (ParameterizedType) field.getGenericType();
            accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[0]);

        } else if(accessor.getType().isArray()) {
            accessor.componentType = Optional.of(accessor.getType().getComponentType());

        } else if(Map.class.isAssignableFrom(accessor.getType())) {
            ParameterizedType type = (ParameterizedType) field.getGenericType();
            accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[1]);
        }

        // 位置・ラベル情報のアクセッサの設定
        if(accessor.hasAnnotation(XlsMapColumns.class)) {
            // マップ形式の場合
            accessor.mapPositionSetter = mapPositionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.mapLabelSetter = mapLabelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

        } else if(accessor.hasAnnotation(XlsArrayColumns.class)
                || accessor.hasAnnotation(XlsArrayCells.class)
                || accessor.hasAnnotation(XlsLabelledArrayCells.class)
                || accessor.hasAnnotation(XlsIterateTables.class)){
            // リストや配列形式の場合
            accessor.arrayPositionSetter = arrayPositionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.arrayLabelSetter = arrayLabelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

            if(accessor.hasAnnotation(XlsArrayColumns.class)
                    || accessor.hasAnnotation(XlsLabelledArrayCells.class)) {
                // インデックスが付いていないラベルの設定
                accessor.labelSetter = labelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            }

        } else {
            // リストやMapではない通常のプロパティの場合
            accessor.positionSetter = positionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.positionGetter = positionGetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

            accessor.labelSetter = labelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.labelGetter = labelGetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

        }

        return accessor;
    }
692951
@SuppressWarnings("unchecked")
	public <T> T getOne(String field) {
		return (T) get(field).get(field);
	}
1167101
private ValuesSourceAggregationBuilder makeCountAgg(MethodField field) {

        // Cardinality is approximate DISTINCT.
        if ("DISTINCT".equals(field.getOption())) {

            if (field.getParams().size() == 1) {
                return AggregationBuilders.cardinality(field.getAlias()).field(field.getParams().get(0).value.toString());
            } else {
                Integer precision_threshold = (Integer) (field.getParams().get(1).value);
                return AggregationBuilders.cardinality(field.getAlias()).precisionThreshold(precision_threshold).field(field.getParams().get(0).value.toString());
            }

        }

        String fieldName = field.getParams().get(0).value.toString();

        /*
        zhongshu-comment count(1) count(0)这种应该是查不到东西的，除非你的字段名就叫做1、0这样
            es的count是针对某个字段做count的，见下面的dsl，对os这个字段做count
                "aggregations": {
                    "COUNT(os)": {
                      "value_count": {
                        "field": "os"
                      }
                    }
                 }

            假如你是写count(*)，那es-sql就帮你转成对"_index"字段做count，每一条数据都会有"_index"字段，该字段存储的是索引的名字
         */
        // In case of count(*) we use '_index' as field parameter to count all documents
        if ("*".equals(fieldName)) {
            KVValue kvValue = new KVValue(null, "_index");
            field.getParams().set(0, kvValue);
            /*
            zhongshu-comment 这个看起来有点多此一举：先将"_index"字符串封装到KVValue中，然后再kv.toString()得到"_index"字符串，还不如直接将"_index"传进去AggregationBuilders.count(field.getAlias()).field("_index");
            其实目的是为了改变形参MethodField field的params参数中的值，由"*"改为"_index"
             */
            return AggregationBuilders.count(field.getAlias()).field(kvValue.toString());
        } else {
            return AggregationBuilders.count(field.getAlias()).field(fieldName);
        }
    }
662485
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case OPERATION_ID:
      return isSetOperationId();
    case OPERATION_TYPE:
      return isSetOperationType();
    case HAS_RESULT_SET:
      return isSetHasResultSet();
    case MODIFIED_ROW_COUNT:
      return isSetModifiedRowCount();
    }
    throw new IllegalStateException();
  }
333508
public Class<?> getActualFieldType(final String field) {
        
        final Object fieldValue = getFieldValue(field);
        return fieldValue == null ? null : fieldValue.getClass();
        
    }
949685
protected Object getRowId(final Object rowBean) {
		String rowIdProperty = getComponentModel().rowIdProperty;

		if (rowIdProperty == null || rowBean == null) {
			return rowBean;
		}

		try {
			return PropertyUtils.getProperty(rowBean, rowIdProperty);
		} catch (Exception e) {
			LOG.error("Failed to read row property \"" + rowIdProperty + "\" on " + rowBean, e);
			return rowBean;
		}
	}
1176850
public static String getFieldName(Field field) {
        String name = field.getName();
        String formattedName = Formatter.toCamelCase(name);
        if (isReservedKeyword(formattedName)) {
            return formattedName + '_';
        }
        return formattedName;
    }
621775
private PropDesc createProp(Field field) {
		final String fieldName = field.getName();
		final Class<?> fieldType = field.getType();
		final boolean isBooeanField = BooleanUtil.isBoolean(fieldType);

		Method getter = null;
		Method setter = null;

		String methodName;
		Class<?>[] parameterTypes;
		for (Method method : ReflectUtil.getMethods(this.beanClass)) {
			parameterTypes = method.getParameterTypes();
			if (parameterTypes.length > 1) {
				// 多于1个参数说明非Getter或Setter
				continue;
			}

			methodName = method.getName();
			if (parameterTypes.length == 0) {
				// 无参数，可能为Getter方法
				if (isMatchGetter(methodName, fieldName, isBooeanField)) {
					// 方法名与字段名匹配，则为Getter方法
					getter = method;
				}
			} else if (isMatchSetter(methodName, fieldName, isBooeanField)) {
				// 只有一个参数的情况下方法名与字段名对应匹配，则为Setter方法
				setter = method;
			}
			if (null != getter && null != setter) {
				// 如果Getter和Setter方法都找到了，不再继续寻找
				break;
			}
		}
		return new PropDesc(field, getter, setter);
	}
1182449
public int dataToField(Field field) throws DBException
    {
        return ((BaseBuffer)this.getDataSource()).getNextField((FieldInfo)field, Constants.DISPLAY, Constants.READ_MOVE);
    }
962386
public int fieldIndex(String field) {
    Integer ret = mIndex.get(field);
    if (ret == null) {
      throw new IllegalArgumentException(field + " does not exist");
    }
    return ret;
  }
400994
def row(self, rownum):
        
        if rownum > len(self):
            raise IndexError("Invalid row index `%s` for DataTable" % rownum)
        return datarow_constructor(self.fields)([self[field][rownum]
                                                 for field in self.fields])
1265267
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case START_ROW_OFFSET:
      return isSetStartRowOffset();
    case ROWS:
      return isSetRows();
    case COLUMNS:
      return isSetColumns();
    }
    throw new IllegalStateException();
  }
145829
public Rowtime timestampsFromField(String fieldName) {
		internalProperties.putString(ROWTIME_TIMESTAMPS_TYPE, ROWTIME_TIMESTAMPS_TYPE_VALUE_FROM_FIELD);
		internalProperties.putString(ROWTIME_TIMESTAMPS_FROM, fieldName);
		return this;
	}
20649
public ByteBuffer getKey(String field) throws IOException {
        int hash = Arrays.hashCode(field.getBytes());
        return getKey(structure.keyHash2Index.get(hash));
    }
478646
private Object getEntityFieldValue(EntityMetadata entityMetadata, Object entity, String field)
    {
        Class clazz = entityMetadata.getEntityClazz();
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        EntityType entityType = metaModel.entity(clazz);

        if (field.indexOf(".") > 0 && entityMetadata.getEntityClazz().equals(entity.getClass()))
        {
            String fieldName = field.substring(field.indexOf(".") + 1, field.length());
            Attribute attribute = entityType.getAttribute(fieldName);
            return PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember());
        }
        else
        {
            // for hbase v2 client (sends arraylist for specific fields)
            if (entity instanceof ArrayList)
            {
                Object element = ((ArrayList) entity).get(0);
                ((ArrayList) entity).remove(0);
                return element;
            }
            else
            {
                return entity;
            }
        }
    }
1103040
@BetaApi
  public static FieldValueList of(List<FieldValue> row, Field... schema) {
    return of(row, schema.length > 0 ? FieldList.of(schema) : null);
  }