Skip to content

Commit

Permalink
Fix util methods
Browse files Browse the repository at this point in the history
  • Loading branch information
minborg committed Oct 15, 2015
1 parent 0ddd754 commit 2b2ed79
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Expand Up @@ -66,6 +66,10 @@ public Optional<PredicateType> getComplementType() {
return complementType;
}

public PredicateType effectiveType(boolean inverted) {
return complementType.orElse(this);
}

private static void associateComplimentTypes(PredicateType a, PredicateType b) {
a.complementType = Optional.of(b);
b.complementType = Optional.of(a);
Expand Down
Expand Up @@ -54,15 +54,15 @@ public SqlStreamTerminator(AbstractSqlManager<ENTITY> manager, final Asynchronou
@Override
public <T extends Pipeline> T optimize(T initialPipeline) {
requireNonNull(initialPipeline);
final List<SpeedmentPredicate<?, ?>> andPredicateBuilders = StreamTerminatorUtil.topLevelAndPredicates(initialPipeline);
final List<SpeedmentPredicate<ENTITY, ?>> andPredicateBuilders = StreamTerminatorUtil.topLevelAndPredicates(initialPipeline);

if (!andPredicateBuilders.isEmpty()) {
modifySource(andPredicateBuilders, asynchronousQueryResult);
}
return initialPipeline;
}

public void modifySource(final List<SpeedmentPredicate<?, ?>> predicateBuilders, AsynchronousQueryResult<ENTITY> qr) {
public void modifySource(final List<SpeedmentPredicate<ENTITY, ?>> predicateBuilders, AsynchronousQueryResult<ENTITY> qr) {
requireNonNull(predicateBuilders);
requireNonNull(qr);
if (predicateBuilders.isEmpty()) {
Expand Down
@@ -1,3 +1,19 @@
/**
*
* Copyright (c) 2006-2015, Speedment, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.speedment.internal.core.stream.builder.streamterminator;

import com.speedment.field.predicate.SpeedmentPredicate;
Expand Down

0 comments on commit 2b2ed79

Please sign in to comment.