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