Search in sources :

Example 1 with DashboardConfigBean

use of com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean in project pinot by linkedin.

the class DashboardConfigManagerImpl method findWhereNameLike.

public List<DashboardConfigDTO> findWhereNameLike(String name) {
    Map<String, Object> parameterMap = new HashMap<>();
    parameterMap.put("name", name);
    List<DashboardConfigBean> list = genericPojoDao.executeParameterizedSQL(FIND_BY_NAME_LIKE, parameterMap, DashboardConfigBean.class);
    List<DashboardConfigDTO> result = new ArrayList<>();
    for (DashboardConfigBean bean : list) {
        result.add(MODEL_MAPPER.map(bean, DashboardConfigDTO.class));
    }
    return result;
}
Also used : DashboardConfigBean(com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO)

Example 2 with DashboardConfigBean

use of com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean in project pinot by linkedin.

the class DashboardConfigManagerImpl method findByName.

@Override
public DashboardConfigDTO findByName(String name) {
    Predicate predicate = Predicate.EQ("name", name);
    List<DashboardConfigBean> list = genericPojoDao.get(predicate, DashboardConfigBean.class);
    DashboardConfigDTO result = null;
    if (CollectionUtils.isNotEmpty(list)) {
        result = MODEL_MAPPER.map(list.get(0), DashboardConfigDTO.class);
    }
    return result;
}
Also used : DashboardConfigBean(com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean) DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 3 with DashboardConfigBean

use of com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean in project pinot by linkedin.

the class DashboardConfigManagerImpl method findByDataset.

@Override
public List<DashboardConfigDTO> findByDataset(String dataset) {
    Predicate predicate = Predicate.EQ("dataset", dataset);
    List<DashboardConfigBean> list = genericPojoDao.get(predicate, DashboardConfigBean.class);
    List<DashboardConfigDTO> result = new ArrayList<>();
    for (DashboardConfigBean abstractBean : list) {
        DashboardConfigDTO dto = MODEL_MAPPER.map(abstractBean, DashboardConfigDTO.class);
        result.add(dto);
    }
    return result;
}
Also used : DashboardConfigBean(com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean) ArrayList(java.util.ArrayList) DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 4 with DashboardConfigBean

use of com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean in project pinot by linkedin.

the class DashboardConfigManagerImpl method findActiveByDataset.

@Override
public List<DashboardConfigDTO> findActiveByDataset(String dataset) {
    Predicate datasetPredicate = Predicate.EQ("dataset", dataset);
    Predicate activePredicate = Predicate.EQ("active", true);
    List<DashboardConfigBean> list = genericPojoDao.get(Predicate.AND(datasetPredicate, activePredicate), DashboardConfigBean.class);
    List<DashboardConfigDTO> result = new ArrayList<>();
    for (DashboardConfigBean abstractBean : list) {
        DashboardConfigDTO dto = MODEL_MAPPER.map(abstractBean, DashboardConfigDTO.class);
        result.add(dto);
    }
    return result;
}
Also used : DashboardConfigBean(com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean) ArrayList(java.util.ArrayList) DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Aggregations

DashboardConfigDTO (com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO)4 DashboardConfigBean (com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean)4 Predicate (com.linkedin.thirdeye.datalayer.util.Predicate)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)1