private void _buildSelect(
                    final SearchCriteria criteria,
                    final StringBuilder stmt
                    )
    {
        final List<Projection>  projections =
            (criteria == null ? null : criteria.getProjections());
        final int  n_projections = (projections == null ? 0 : projections.size());
        final boolean  distinct =
            (criteria == null ? true : criteria.isDistinct());

        // SELECT
        stmt.append( _SELECT_ );
        if (distinct) {
            // SELECT DISTINCT
            stmt.append( _DISTINCT_ );
        }

        if (n_projections == 0) {
            //SELECT {DISTINCT} T
            stmt.append( _alias );
        } else {
            //SELECT {DISTINCT} T.a,T.b,T.c
            for (int  i = 0; i < n_projections; i++) {
                if (i > 0) {
                    stmt.append( "," );
                }
                _buildProjection( projections.get( i ), stmt );
                //throws SearchException
            }
        }
    }
private void _buildSelect ( final SearchCriteria criteria , final StringBuilder stmt ) { final List < Projection > projections = ( criteria == null ? null : criteria . getProjections ( ) ) ; final int n_projections = ( projections == null ? 0 : projections . size ( ) ) ; final boolean distinct = ( criteria == null ? true : criteria . isDistinct ( ) ) ; stmt . append ( _SELECT_ ) ; if ( distinct ) { stmt . append ( _DISTINCT_ ) ; } if ( n_projections == 0 ) { stmt . append ( _alias ) ; } else { for ( int i = 0 ; i < n_projections ; i ++ ) { if ( i > 0 ) { stmt . append ( "," ) ; } _buildProjection ( projections . get ( i ) , stmt ) ; } } }
SELECT
SELECT {DISTINCT} T
SELECT {DISTINCT} T.a, T.b, T.c