/**
 *
 * Copyright (c) 2006-2016, 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.component;

import com.speedment.annotation.Api;
import com.speedment.exception.SpeedmentException;
import com.speedment.field.ComparableField;
import com.speedment.stream.StreamDecorator;
import java.util.Optional;
import java.util.stream.Stream;

/**
 * This Component interface is used to obtain streams for different tables.
 *
 * @author pemi
 * @since 2.2
 */
@Api(version = "2.2")
public interface StreamSupplierComponent extends Component {

    @Override
    default Class<StreamSupplierComponent> getComponentClass() {
        return StreamSupplierComponent.class;
    }

    /**
     * Basic stream over all entities.
     *
     * @param <ENTITY> entity type
     * @param entityClass the entity class
     * @param decorator decorates the stream before building it
     * @return a stream for the given entity class
     */
    <ENTITY> Stream<ENTITY> stream(Class<ENTITY> entityClass, StreamDecorator decorator);

    default <ENTITY, D, V extends Comparable<? super V>>
            Optional<ENTITY> findAny(Class<ENTITY> entityClass, ComparableField<ENTITY, D, V> field, V value) {
        return stream(entityClass, StreamDecorator.IDENTITY)
                .filter(field.equal(value))
                .findAny();
    }

}

@@ -739,36 +739,86 @@
 ent.
-exception.SpeedmentException
+field.trait.ComparableFieldTrait;%0D%0Aimport com.speedment.field.trait.FieldTrait
 ;%0D%0Ai
@@ -843,31 +843,41 @@
 t.field.
-Comparabl
+trait.Referenc
 eField
+Trait
 ;%0D%0Aimpor
@@ -1735,16 +1735,111 @@
 %3C? super
+ V%3E, F extends FieldTrait & ReferenceFieldTrait%3CENTITY, D, V%3E & ComparableFieldTrait%3CENTITY, D,
  V%3E%3E%0D%0A  
@@ -1904,37 +1904,9 @@
 ss, 
-ComparableField%3CENTITY, D, V%3E
+F
  fie

Update findAny so it supports all field types