@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; }
@Override public String getFieldPropertyName(MetaField field, FieldProperty property) { return field.getFlattenPropertyValueDbName(property); }
@Override public String getFieldInnerPropertyName(MetaField field, String innerField) { return field.getFlattenValueDbName() + "." + innerField; }
@Override public String getFieldValueName(MetaField field) { return field.getFlattenValueDbName(); }