예제 #1
0
  @Override
  public boolean isIndexUsable(ISearchField field, MetaClass metaClass) {
    Collection<IndexInfo> indexes = metaClass.getIndexesOnField(field.getFieldName());
    for (IndexInfo index : indexes) {
      String firstKey = index.getKeyList().get(0);
      MetaField metaField = metaClass.getFieldByName(firstKey);

      String physicalKeyName = getFieldValueName(metaField);
      if (metaField.getDataType().equals(DataTypeEnum.RELATIONSHIP)) {
        physicalKeyName =
            metaField.getFlattenValueDbName()
                + AbstractEntityIDHelper.DOT
                + InternalFieldEnum.ID.getDbName();
      }
      if (physicalKeyName.equals(field.getFullDbName())) {
        return true;
      }
    }
    return false;
  }
예제 #2
0
 @Override
 public String getFieldPropertyName(MetaField field, FieldProperty property) {
   return field.getFlattenPropertyValueDbName(property);
 }
예제 #3
0
 @Override
 public String getFieldInnerPropertyName(MetaField field, String innerField) {
   return field.getFlattenValueDbName() + "." + innerField;
 }
예제 #4
0
 @Override
 public String getFieldValueName(MetaField field) {
   return field.getFlattenValueDbName();
 }