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

org.babyfish.jimmer.sql.ast.PropExpression Maven / Gradle / Ivy

The newest version!
package org.babyfish.jimmer.sql.ast;

import org.babyfish.jimmer.EmbeddableDto;
import org.babyfish.jimmer.View;
import org.babyfish.jimmer.meta.ImmutableProp;
import org.babyfish.jimmer.sql.ast.impl.CoalesceBuilder;
import org.babyfish.jimmer.sql.fetcher.Fetcher;
import org.jetbrains.annotations.NotNull;

public interface PropExpression extends Expression {

    interface Str extends PropExpression, StringExpression {

        @Override
        @NotNull
        StringExpression coalesce(String defaultValue);

        @Override
        @NotNull
        StringExpression coalesce(Expression defaultExpr);

        @Override
        CoalesceBuilder.@NotNull Str coalesceBuilder();
    }

    interface Num> extends PropExpression, NumericExpression {

        @Override
        @NotNull
        NumericExpression coalesce(N defaultValue);

        @Override
        @NotNull
        NumericExpression coalesce(Expression defaultExpr);

        @Override
        CoalesceBuilder.@NotNull Num coalesceBuilder();
    }

    interface Cmp> extends PropExpression, ComparableExpression {

        @Override
        @NotNull
        ComparableExpression coalesce(T defaultValue);

        @Override
        @NotNull
        ComparableExpression coalesce(Expression defaultExpr);

        @Override
        CoalesceBuilder.@NotNull Cmp coalesceBuilder();
    }

    interface Embedded extends PropExpression {

        > XE get(String prop);

        > XE get(ImmutableProp prop);

        Selection fetch(Fetcher fetcher);

        > Selection fetch(Class dtoType);

        @Override
        default @NotNull Expression coalesce(T defaultValue) {
            throw new UnsupportedOperationException("Embedded property does not support coalesce");
        }

        @Override
        default @NotNull Expression coalesce(Expression defaultExpr) {
            throw new UnsupportedOperationException("Embedded property does not support coalesce");
        }

        @Override
        default @NotNull CoalesceBuilder coalesceBuilder() {
            throw new UnsupportedOperationException("Embedded property does not support coalesce");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy