Search in sources :

Example 1 with UsedAggregate

use of com.servoy.j2db.scripting.UsedDataProviderTracker.UsedAggregate in project servoy-client by Servoy.

the class Record method manageCalcDependency.

protected void manageCalcDependency(String calc, UsedDataProviderTracker usedDataProviderTracker) {
    if (usedDataProviderTracker == null) {
        return;
    }
    Set<String> usedGlobals = usedDataProviderTracker.getGlobals();
    if (usedGlobals != null) {
        for (String usedGlobal : usedGlobals) {
            row.getRowManager().addCalculationGlobalDependency(usedGlobal, calc);
        }
    }
    Set<UsedDataProvider> usedColumns = usedDataProviderTracker.getColumns();
    if (usedColumns != null) {
        for (UsedDataProvider usedColumn : usedColumns) {
            try {
                RowManager rowManager = ((FoundSetManager) parent.getFoundSetManager()).getRowManager(usedColumn.dataSource);
                if (rowManager != null) {
                    rowManager.addCalculationDependency(usedColumn.pkHashKey, usedColumn.dataProviderId, parent.getDataSource(), getPKHashKey(), calc);
                }
            } catch (ServoyException e) {
                Debug.error(e);
            }
        }
    }
    Set<UsedRelation> uedRelations = usedDataProviderTracker.getRelations();
    if (uedRelations != null) {
        for (UsedRelation usedRelation : uedRelations) {
            row.getRowManager().addCalculationRelationDependency(usedRelation.whereArgsHash, usedRelation.name, parent.getDataSource(), getPKHashKey(), calc);
        }
    }
    Set<UsedAggregate> usedAggregates = usedDataProviderTracker.getAggregates();
    if (usedAggregates != null) {
        for (UsedAggregate usedAggregate : usedAggregates) {
            row.getRowManager().addCalculationAggregateDependency(usedAggregate.foundSet, usedAggregate.name, calc);
        }
    }
}
Also used : UsedDataProvider(com.servoy.j2db.scripting.UsedDataProviderTracker.UsedDataProvider) UsedRelation(com.servoy.j2db.scripting.UsedDataProviderTracker.UsedRelation) ServoyException(com.servoy.j2db.util.ServoyException) UsedAggregate(com.servoy.j2db.scripting.UsedDataProviderTracker.UsedAggregate)

Aggregations

UsedAggregate (com.servoy.j2db.scripting.UsedDataProviderTracker.UsedAggregate)1 UsedDataProvider (com.servoy.j2db.scripting.UsedDataProviderTracker.UsedDataProvider)1 UsedRelation (com.servoy.j2db.scripting.UsedDataProviderTracker.UsedRelation)1 ServoyException (com.servoy.j2db.util.ServoyException)1