Search in sources :

Example 6 with MetaSelect

use of com.axelor.meta.db.MetaSelect in project axelor-open-suite by axelor.

the class AdvancedExportServiceImpl method checkSelectionField.

private void checkSelectionField(String[] fieldName, int index, MetaModel metaModel) throws ClassNotFoundException {
    Class<?> klass = Class.forName(metaModel.getFullName());
    Mapper mapper = Mapper.of(klass);
    List<MetaSelect> metaSelectList = metaSelectRepo.all().filter("self.name = ?", mapper.getProperty(fieldName[index]).getSelection()).fetch();
    if (CollectionUtils.isNotEmpty(metaSelectList)) {
        isSelectionField = true;
        String alias = "self";
        msi++;
        mt++;
        if (!isNormalField && index != 0) {
            alias = aliasName;
        }
        addSelectionField(fieldName[index], alias, StringTool.getIdListString(metaSelectList));
    }
}
Also used : Mapper(com.axelor.db.mapper.Mapper) MetaSelect(com.axelor.meta.db.MetaSelect)

Aggregations

MetaSelect (com.axelor.meta.db.MetaSelect)6 MetaSelectItem (com.axelor.meta.db.MetaSelectItem)3 Mapper (com.axelor.db.mapper.Mapper)1 MetaSelectRepository (com.axelor.meta.db.repo.MetaSelectRepository)1 Transactional (com.google.inject.persist.Transactional)1 HashMap (java.util.HashMap)1