//Get the where fields
List<WhereField> whereFields = query.getWhereFields();
if(whereFields!=null){
for(int i=0; i<whereFields.size(); i++){
WhereField whereField = whereFields.get(i);
Operand leftOperand = whereField.getLeftOperand();
if(statement.OPERAND_TYPE_FIELD.equalsIgnoreCase(leftOperand.type)){
datamartField = statement.getDataSource().getModelStructure().getField( leftOperand.values[0] );
concernedEntities.add(datamartField.getPathParent());
}
Operand rightOperand = whereField.getLeftOperand();
if(statement.OPERAND_TYPE_FIELD.equalsIgnoreCase(rightOperand.type)){
datamartField = statement.getDataSource().getModelStructure().getField( rightOperand.values[0] );
concernedEntities.add(datamartField.getPathParent());
}
}
}
//Get the having fields
List<HavingField> havingFields = query.getHavingFields();
if(havingFields!=null){
for(int i=0; i<havingFields.size(); i++){
HavingField havingField = havingFields.get(i);
Operand leftOperand = havingField.getLeftOperand();
if(statement.OPERAND_TYPE_FIELD.equalsIgnoreCase(leftOperand.type)){
datamartField = statement.getDataSource().getModelStructure().getField( leftOperand.values[0] );
concernedEntities.add(datamartField.getPathParent());
}
Operand rightOperand = havingField.getLeftOperand();
if(statement.OPERAND_TYPE_FIELD.equalsIgnoreCase(rightOperand.type)){
datamartField = statement.getDataSource().getModelStructure().getField( rightOperand.values[0] );
concernedEntities.add(datamartField.getPathParent());
}
}