Java Code Examples for org.pentaho.di.core.database.DatabaseMeta#getFunctionMaximum()

The following examples show how to use org.pentaho.di.core.database.DatabaseMeta#getFunctionMaximum() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SQLGenerator.java    From pentaho-metadata with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static String getFunction( Selection column, DatabaseMeta databaseMeta ) {
  String fn = ""; //$NON-NLS-1$

  switch ( column.getActiveAggregationType().getType() ) {
    case AggregationSettings.TYPE_AGGREGATION_AVERAGE:
      fn = databaseMeta.getFunctionAverage();
      break;
    case AggregationSettings.TYPE_AGGREGATION_COUNT_DISTINCT:
    case AggregationSettings.TYPE_AGGREGATION_COUNT:
      fn = databaseMeta.getFunctionCount();
      break;
    case AggregationSettings.TYPE_AGGREGATION_MAXIMUM:
      fn = databaseMeta.getFunctionMaximum();
      break;
    case AggregationSettings.TYPE_AGGREGATION_MINIMUM:
      fn = databaseMeta.getFunctionMinimum();
      break;
    case AggregationSettings.TYPE_AGGREGATION_SUM:
      fn = databaseMeta.getFunctionSum();
      break;
    default:
      break;
  }

  return fn;
}
 
Example 2
Source File: SqlGenerator.java    From pentaho-metadata with GNU Lesser General Public License v2.1 6 votes vote down vote up
private static String getFunction( Selection column, DatabaseMeta databaseMeta ) {
  String fn = ""; //$NON-NLS-1$

  switch ( column.getActiveAggregationType() ) {
    case AVERAGE:
      fn = databaseMeta.getFunctionAverage();
      break;
    case COUNT_DISTINCT:
    case COUNT:
      fn = databaseMeta.getFunctionCount();
      break;
    case MAXIMUM:
      fn = databaseMeta.getFunctionMaximum();
      break;
    case MINIMUM:
      fn = databaseMeta.getFunctionMinimum();
      break;
    case SUM:
      fn = databaseMeta.getFunctionSum();
      break;
    default:
      break;
  }

  return fn;
}