All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dellroad.querystream.jpa.ExprValue Maven / Gradle / Ivy


/*
 * Copyright (C) 2018 Archie L. Cobbs. All rights reserved.
 */

package org.dellroad.querystream.jpa;

import java.util.Collection;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;

import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.From;
import javax.persistence.criteria.Path;
import javax.persistence.criteria.Selection;
import javax.persistence.metamodel.MapAttribute;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;

/**
 * An {@link ExprStream} that is guaranteed to return at most a single result.
 */
public interface ExprValue> extends SearchValue, ExprStream {

// Narrowing overrides (ExprStream)

    @Override
    default  PathValue> map(SingularAttribute attribute) {
        return ((PathStreamImpl>)ExprStream.super.map(attribute)).toValue();
    }

    @Override
    default  ExprValue> map(Class type, Function> exprFunction) {
        return ((ExprStreamImpl>)ExprStream.super.map(type, exprFunction)).toValue();
    }

    @Override
    default > ExprValue> map(PluralAttribute attribute) {
        return ((ExprStreamImpl>)ExprStream.super.map(attribute)).toValue();
    }

    @Override
    default > ExprValue> map(MapAttribute attribute) {
        return ((ExprStreamImpl>)ExprStream.super.map(attribute)).toValue();
    }

    @Override
    default  PathValue> mapToPath(Class type, Function> pathFunction) {
        return ((PathStreamImpl>)ExprStream.super.mapToPath(type, pathFunction)).toValue();
    }

    @Override
    default  FromValue> mapToFrom(Class type, Function> fromFunction) {
        return ((FromStreamImpl>)ExprStream.super.mapToFrom(type, fromFunction)).toValue();
    }

    @Override
    default DoubleValue mapToDouble(SingularAttribute attribute) {
        return ((DoubleStreamImpl)ExprStream.super.mapToDouble(attribute)).toValue();
    }

    @Override
    default DoubleValue mapToDouble(Function> doubleExprFunction) {
        return ((DoubleStreamImpl)ExprStream.super.mapToDouble(doubleExprFunction)).toValue();
    }

    @Override
    default LongValue mapToLong(SingularAttribute attribute) {
        return ((LongStreamImpl)ExprStream.super.mapToLong(attribute)).toValue();
    }

    @Override
    default LongValue mapToLong(Function> longExprFunction) {
        return ((LongStreamImpl)ExprStream.super.mapToLong(longExprFunction)).toValue();
    }

    @Override
    default IntValue mapToInt(SingularAttribute attribute) {
        return ((IntStreamImpl)ExprStream.super.mapToInt(attribute)).toValue();
    }

    @Override
    default IntValue mapToInt(Function> intExprFunction) {
        return ((IntStreamImpl)ExprStream.super.mapToInt(intExprFunction)).toValue();
    }

// Narrowing overrides (QueryStream)

    @Override
    ExprValue bind(Ref ref);

    @Override
    ExprValue peek(Consumer peeker);

    @Override
    > ExprValue bind(Ref ref, Function refFunction);

    @Override
    ExprValue filter(SingularAttribute attribute);

    @Override
    ExprValue filter(Function> predicateBuilder);

    @Override
    ExprValue withFlushMode(FlushModeType flushMode);

    @Override
    ExprValue withLockMode(LockModeType lockMode);

    @Override
    ExprValue withHint(String name, Object value);

    @Override
    ExprValue withHints(Map hints);

    @Override
    ExprValue withLoadGraph(String name);

    @Override
    ExprValue withFetchGraph(String name);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy